Skip to content

Commit d8085d3

Browse files
committed
Add a test case for getting WCCC tx by tracker
The added test case succeeds on this branch but fails on current master branch because current master doesn't store WrapCCC tracker in body_db.
1 parent 76ab889 commit d8085d3

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/src/e2e/wrap.test.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,33 @@ describe("WrapCCC", function() {
198198
).to.be.rejected;
199199
}).timeout(30_000);
200200

201+
it("WCCC tracker should return the corresponding transaction", async function() {
202+
const wrapCCC = node.sdk.core.createWrapCCCTransaction({
203+
shardId: 0,
204+
recipient: await node.createP2PKHBurnAddress(),
205+
quantity: 30,
206+
payer: PlatformAddress.fromAccountId(faucetAccointId, {
207+
networkId: "tc"
208+
})
209+
});
210+
const seq = (await node.sdk.rpc.chain.getSeq(faucetAddress))!;
211+
expect(seq).not.to.be.null;
212+
const signedWrapCCC = wrapCCC.sign({
213+
secret: faucetSecret,
214+
seq,
215+
fee: 10
216+
});
217+
218+
const hash = await node.sdk.rpc.chain.sendSignedTransaction(
219+
signedWrapCCC
220+
);
221+
const tracker = wrapCCC.tracker();
222+
223+
expect(await node.sdk.rpc.chain.containsTransaction(hash)).be.true;
224+
expect(await node.sdk.rpc.chain.getTransactionByTracker(tracker)).not
225+
.null;
226+
});
227+
201228
afterEach(async function() {
202229
await node.clean();
203230
});

0 commit comments

Comments
 (0)