Skip to content

Commit

Permalink
raw signed transaction test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
joshisakshi committed Feb 21, 2025
1 parent 0b74459 commit c797bf3
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions modules/sdk-coin-tao/test/unit/transactionBuilder/unstakeBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,27 +84,30 @@ describe('Tao Unstake Builder', function () {
should.deepEqual(txJson.chainName, chainName);
should.deepEqual(txJson.eraPeriod, 64);
});
// it('should build from raw signed tx', async function () {
// builder.from('0x55028400aaa34f9f3c1f685e2bac444a4e2d50d302a16f0550f732dd799f854dda7ec77201223b6649a7d5e23c384a6deb8c76ff46a44958dbae8e640beb35b1d0e940f57185b2efc8497c848cd187f6f5fbf2cd199bf3f7a016085c45d7d68b05b3421a88b4019d05000007038a90be061598f4b592afbd546bcb6beadb3c02f5c129df2e11b698f9543dbd41000000e1f50500000000');
// // builder.validity({ firstValid: 3933, maxDuration: 64 }).referenceBlock(referenceBlock);
// console.log('Building transaction...');
// const tx = await builder.build();
// const txJson = tx.toJson();
// console.log('Transaction JSON:', JSON.stringify(txJson, null, 2));
// should.deepEqual(txJson.amount, '50000000000000');
// should.deepEqual(txJson.to, '5FCPTnjevGqAuTttetBy4a24Ej3pH9fiQ8fmvP1ZkrVsLUoT');
// should.deepEqual(txJson.netuid, '0');
// should.deepEqual(txJson.sender, '5F1mFBGhm7FrSKftDxzFPN8U1BqHKSAxEDhTV2Yx5JhCe2Nk');
// should.deepEqual(txJson.blockNumber,3933);
// should.deepEqual(txJson.referenceBlock, referenceBlock);
// should.deepEqual(txJson.genesisHash, genesisHash);
// should.deepEqual(txJson.specVersion, specVersion);
// should.deepEqual(txJson.nonce, 0);
// should.deepEqual(txJson.tip, 0);
// should.deepEqual(txJson.transactionVersion, txVersion);
// should.deepEqual(txJson.chainName, chainName);
// should.deepEqual(txJson.eraPeriod, 64);
// });
it('should build from raw signed tx', async function () {
// builder.from(rawTx.unstake.signed);
//using from coins-sandbox
builder.from(
'0x55028400aaa34f9f3c1f685e2bac444a4e2d50d302a16f0550f732dd799f854dda7ec77201a4e5222aea1ea19ae4b8f7a542c891e5d8372d9aaafabc4616ecc89fac429a5793b29f79b709c46b41a88634ab2002e69d7777fd095fe014ddad858900155f897401a505000007038a90be061598f4b592afbd546bcb6beadb3c02f5c129df2e11b698f9543dbd41000000e1f50500000000'
);
builder.validity({ firstValid: 3933, maxDuration: 64 }).referenceBlock(referenceBlock);
console.log('Building transaction...');
const tx = await builder.build();
const txJson = tx.toJson();
should.deepEqual(txJson.amount, '100000000');
should.deepEqual(txJson.to, '5FCPTnjevGqAuTttetBy4a24Ej3pH9fiQ8fmvP1ZkrVsLUoT');
should.deepEqual(txJson.netuid, '0');
should.deepEqual(txJson.sender, '5FvSWbV4hGC7GvXQKKtiVmmHSH3JELK8R3JS8Z5adnACFBwh');
should.deepEqual(txJson.blockNumber, 3933);
should.deepEqual(txJson.referenceBlock, referenceBlock);
should.deepEqual(txJson.genesisHash, genesisHash);
should.deepEqual(txJson.specVersion, specVersion);
should.deepEqual(txJson.nonce, 361);
should.deepEqual(txJson.tip, 0);
should.deepEqual(txJson.transactionVersion, txVersion);
should.deepEqual(txJson.chainName, chainName);
should.deepEqual(txJson.eraPeriod, 64);
});
// it('should build from raw unsigned tx', async function () {
// builder.from(rawTx.unstake.unsigned);
// builder
Expand Down

0 comments on commit c797bf3

Please sign in to comment.