Skip to content

Commit 03f9ac0

Browse files
Merge pull request #7378 from BitGo/SC-3642
test(sdk-coin-vet): fix test data for stake
2 parents c0e97f3 + 89a94bb commit 03f9ac0

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

modules/sdk-coin-vet/test/resources/vet.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ export const SPONSORED_NFT_TRANSACTION =
1414
export const STAKING_TRANSACTION =
1515
'0xf901032788015d55fcf2457e7c40f866f864941856c533ac2d94340aaa8544d35a5c1d4a21dee7880de0b6b3a7640000b844d8da3bbf0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000181808265848083094c53c101b882efcb9ea88e908d1a142db96c1b44dd056ea194f1ad45670c100a8c52348cc7b20387741260ebe7fe9b7594f96693c88662fa60edba5992332728222b0bdd8a30008535368bd901319eb4513d16bebc428dc8454d32a19eeb76372849a6134ebbba79f1eeceea1f6546574b945c05489222cb451f5b0e2901b0c687b750e833aeb800';
1616

17+
export const STAKE_CLAUSE_TRANSACTION =
18+
'0xf8e3278801618b7b1354c4ca40f845f843941ec1d168574603ec35b9d229843b7c2b44bcb770880de0b6b3a7640000a4604f2177000000000000000000000000000000000000000000000000000000000000000881808305fd5a808307b278c101b882b380970580d957b8e7989aa9aa9281e57245fa3835cb2aaae6475b4062bb4f1c2dd2ca694df6503d5dfd654579130b3484bee75420247cf8f6b6b4b76b7939f101db6e6cef5a27375274741f3c0aba4be13a9e086337c3290866afe049efcdaa2d3227c9e12b52627c4d71f5b667821f9d33adcc4c97fdc28b93c34013d32e242300';
19+
1720
export const DELEGATION_TRANSACTION =
1821
'0xf8fb278801618aa3e0a55fc940f85ef85c947240e3bc0d26431512d5b67dbd26d199205bffe880b8443207555d00000000000000000000000000000000000000000000000000000000000187690000000000000000000000000000000000000000000000000000000000000001818082e43a808306af07c101b882fb8030f6e2ef6563ff3b0e7e2a2292c1db5fc41c7ab9f598bad370c5cfd3dc32286ae8d709e941c0312c8cd33a3505156b44d1639c73980ffa66bc72f37820f2001c0e6b6e76a6a4d806c377a0a279053eb6ea4356bd235f4396585bb071d70f992c639d45c53431a3c1493a52a136203905e42c671dd384ee5f5ead0a70cb607001';
1922

modules/sdk-coin-vet/test/transactionBuilder/delegateClauseTxnBuilder.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ describe('VET Delegation Transaction', function () {
151151
toJson.gasPriceCoef.should.equal(128);
152152
toJson.expiration.should.equal(64);
153153
toJson.chainTag.should.equal(39);
154+
// in delegate txn, nftTokenId indicates the tokenId
154155
toJson.nftTokenId?.should.equal(tokenId);
155156
toJson.autorenew?.should.equal(true);
156157
});

modules/sdk-coin-vet/test/transactionBuilder/stakeClauseTransactionBuilder.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,17 +237,18 @@ describe('VET Staking Transaction', function () {
237237
});
238238

239239
it('should build a signed tx and validate its toJson', async function () {
240-
const txBuilder = factory.from(testData.STAKING_TRANSACTION);
240+
const txBuilder = factory.from(testData.STAKE_CLAUSE_TRANSACTION);
241241
const tx = txBuilder.transaction as StakeClauseTransaction;
242242
const toJson = tx.toJson();
243-
toJson.id.should.equal('0x99325b39cd04bd1821f6f6af7b679c247e6425a4eb95eb429fa8dff477298d0e');
244-
toJson.stakingContractAddress?.should.equal('0x1856c533ac2d94340aaa8544d35a5c1d4a21dee7');
243+
toJson.id.should.equal('0x2f96e4c16d70bd3e2dabec29a07eb3d6066691ba5b812d6e897676f6ebc0a798');
244+
toJson.stakingContractAddress?.should.equal('0x1ec1d168574603ec35b9d229843b7c2b44bcb770');
245245
toJson.amountToStake?.should.equal('0xde0b6b3a7640000');
246-
toJson.nonce.should.equal('609363');
247-
toJson.gas.should.equal(25988);
246+
toJson.nonce.should.equal('504440');
247+
toJson.gas.should.equal(392538);
248248
toJson.gasPriceCoef.should.equal(128);
249249
toJson.expiration.should.equal(64);
250250
toJson.chainTag.should.equal(39);
251+
// in stake txn, nftTokenId indicates the levelId
251252
toJson.nftTokenId?.should.equal(8);
252253
});
253254
});

0 commit comments

Comments
 (0)