From 5b77508d25bea20d634f1d23a586264d01a08ba4 Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Tue, 13 Sep 2022 15:22:19 -0400 Subject: [PATCH] fix: replace computed max u64 constant with literal --- web3.js/src/programs/address-lookup-table/state.ts | 2 +- web3.js/test/message-tests/compiled-keys.test.ts | 2 +- web3.js/test/message-tests/v0.test.ts | 2 +- web3.js/test/transaction-tests/message.test.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web3.js/src/programs/address-lookup-table/state.ts b/web3.js/src/programs/address-lookup-table/state.ts index 6f4432b25f1dd2..e4558674748a6b 100644 --- a/web3.js/src/programs/address-lookup-table/state.ts +++ b/web3.js/src/programs/address-lookup-table/state.ts @@ -32,7 +32,7 @@ export class AddressLookupTableAccount { } isActive(): boolean { - const U64_MAX = 2n ** 64n - 1n; + const U64_MAX = 18446744073709551615n; return this.state.deactivationSlot === U64_MAX; } diff --git a/web3.js/test/message-tests/compiled-keys.test.ts b/web3.js/test/message-tests/compiled-keys.test.ts index a44f7bdd6cfcb6..28e1366a78e2e4 100644 --- a/web3.js/test/message-tests/compiled-keys.test.ts +++ b/web3.js/test/message-tests/compiled-keys.test.ts @@ -12,7 +12,7 @@ function createTestKeys(count: number): Array { function createTestLookupTable( addresses: Array, ): AddressLookupTableAccount { - const U64_MAX = 2n ** 64n - 1n; + const U64_MAX = 18446744073709551615n; return new AddressLookupTableAccount({ key: PublicKey.unique(), state: { diff --git a/web3.js/test/message-tests/v0.test.ts b/web3.js/test/message-tests/v0.test.ts index 1f95b1d3b7d682..898f18a5b5d73d 100644 --- a/web3.js/test/message-tests/v0.test.ts +++ b/web3.js/test/message-tests/v0.test.ts @@ -18,7 +18,7 @@ function createTestKeys(count: number): Array { function createTestLookupTable( addresses: Array, ): AddressLookupTableAccount { - const U64_MAX = 2n ** 64n - 1n; + const U64_MAX = 18446744073709551615n; return new AddressLookupTableAccount({ key: PublicKey.unique(), state: { diff --git a/web3.js/test/transaction-tests/message.test.ts b/web3.js/test/transaction-tests/message.test.ts index c322c5f36573fb..909e26d420d89f 100644 --- a/web3.js/test/transaction-tests/message.test.ts +++ b/web3.js/test/transaction-tests/message.test.ts @@ -17,7 +17,7 @@ function createTestKeys(count: number): Array { function createTestLookupTable( addresses: Array, ): AddressLookupTableAccount { - const U64_MAX = 2n ** 64n - 1n; + const U64_MAX = 18446744073709551615n; return new AddressLookupTableAccount({ key: PublicKey.unique(), state: {