File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { PublicClient } from "viem";
88import { PolkadotSigner , TypedApi } from "polkadot-api" ;
99import { toViemAddress , convertPublicKeyToSs58 } from "../src/address-utils"
1010import { IAlphaABI , IALPHA_ADDRESS } from "../src/contracts/alpha"
11+ import { u64 } from "@polkadot-api/substrate-bindings" ;
1112
1213describe ( "Test Alpha Precompile" , ( ) => {
1314 // init substrate part
@@ -222,6 +223,9 @@ describe("Test Alpha Precompile", () => {
222223
223224 assert . strictEqual ( ckBurn , ckBurnOnChain , "CK burn should match on chain" ) ;
224225 assert . ok ( ckBurn !== undefined , "CK burn should be defined" ) ;
226+ const ckBurnPercentage = BigInt ( ckBurn ) * BigInt ( 100 ) / BigInt ( 2 ** 64 - 1 )
227+ assert . ok ( ckBurnPercentage >= BigInt ( 0 ) , "CK burn percentage should be non-negative" ) ;
228+ assert . ok ( ckBurnPercentage <= BigInt ( 100 ) , "CK burn percentage should be less than or equal to 100" ) ;
225229 assert . ok ( typeof ckBurn === 'bigint' , "CK burn should be a bigint" ) ;
226230 } ) ;
227231 } ) ;
You can’t perform that action at this time.
0 commit comments