Skip to content

Commit 3fd2f16

Browse files
committed
check burn rate scope
1 parent addca32 commit 3fd2f16

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

evm-tests/test/alpha.precompile.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { PublicClient } from "viem";
88
import { PolkadotSigner, TypedApi } from "polkadot-api";
99
import { toViemAddress, convertPublicKeyToSs58 } from "../src/address-utils"
1010
import { IAlphaABI, IALPHA_ADDRESS } from "../src/contracts/alpha"
11+
import { u64 } from "@polkadot-api/substrate-bindings";
1112

1213
describe("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
});

0 commit comments

Comments
 (0)