Skip to content

Commit 495f3f2

Browse files
committed
Update computation of expiration block height (#300)
* PoS Spending Limits UI * Update computation of expiration block height
1 parent e448bf4 commit 495f3f2

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ COPY ./package.json .
88
COPY ./package-lock.json .
99
COPY ./.npmrc .
1010

11-
# use yarn to upgrade npm
12-
RUN yarn global add npm@7
13-
1411
# install frontend dependencies before copying the frontend code
1512
# into the container so we get docker cache benefits
1613
RUN npm install

src/app/account.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ export class AccountService {
351351
const btcDepositAddress = 'Not implemented yet';
352352
const ethDepositAddress = 'Not implemented yet';
353353

354-
// days * (24 hours / day) * (60 minutes / hour) * (1 block / 5 minutes) = blocks
355-
const numBlocksBeforeExpiration = (numDaysBeforeExpiration * 24 * 60) / 5;
354+
// days * (24 hours / day) * (60 minutes / hour) * (60 seconds / minute) * (1 block / second) = blocks
355+
const numBlocksBeforeExpiration = numDaysBeforeExpiration * 24 * 60 * 60;
356356

357357
// By default, we authorize this derived key for 8640 blocks, which is about 30 days.
358358
const expirationBlock = blockHeight + numBlocksBeforeExpiration;

0 commit comments

Comments
 (0)