Skip to content

Commit c80325b

Browse files
committed
Update expiration block height computation
1 parent 635e34b commit c80325b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/identity/derived-key-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ export async function generateDerivedKeyPayload(
2323
) {
2424
const { BlockHeight } = await getAppState();
2525

26-
// days * (24 hours / day) * (60 minutes / hour) * (1 block / 5 minutes) = blocks
26+
// days * (24 hours / day) * (60 minutes / hour) * (60 seconds / minute) * (1 block / 1 second) = blocks
2727
const expirationBlockHeight =
28-
BlockHeight + (numDaysBeforeExpiration * 24 * 60) / 5;
28+
BlockHeight + numDaysBeforeExpiration * 24 * 60 * 60;
2929
const ownerPublicKeyBase58 = publicKeyToBase58Check(ownerKeys.public, {
3030
network,
3131
});

src/identity/identity.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ describe('identity', () => {
10081008
});
10091009
describe('loginWithAutoDerive()', () => {
10101010
it('it stores the expected derive data when generating a local derived key payload', async () => {
1011-
const expectedExpirationBlock = 1294652;
1011+
const expectedExpirationBlock = 315603452;
10121012
const expectedDerivePayload = {
10131013
derivedPublicKeyBase58Check:
10141014
'BC1YLhKdgXgrZ1XkCzbmP6T9bumth2DgPwNjMksCAXe5kGU9LnxQtsX',

0 commit comments

Comments
 (0)