From 7708406771bad5db5aee54c2b81d1f8a00d6703c Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Mon, 19 Aug 2024 22:00:05 -0500 Subject: [PATCH] gettx test --- test/cli.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/cli.test.ts b/test/cli.test.ts index e3d715d..5d84875 100644 --- a/test/cli.test.ts +++ b/test/cli.test.ts @@ -224,6 +224,22 @@ describe('Test laconic CLI commands', () => { expect(outputObj.accounts.length).toEqual(2); expect(outputObj.accounts).toMatchObject(expectedAccounts); }); + test('laconic registry tokens gettx --hash ', async () => { + const sendAmount = 1000000000; + + const sendResult = spawnSync('laconic', ['registry', 'tokens', 'send', '--address', testAccount2, '--type', TOKEN_TYPE, '--quantity', sendAmount.toString()]); + const sendOutput = checkResultAndRetrieveOutput(sendResult); + expect(sendOutput.tx.code).toEqual(0); + + const gettxResult = spawnSync('laconic', ['registry', 'tokens', 'gettx', '--hash', sendOutput.tx.hash]); + const gettxOutput = checkResultAndRetrieveOutput(gettxResult); + + expect(gettxOutput.hash).toEqual(sendOutput.tx.hash); + expect(gettxOutput.code).toEqual(0); + expect(gettxOutput.amount).toEqual(`${sendAmount}${TOKEN_TYPE}`); + expect(gettxOutput.sender).toEqual(testAccount); + expect(gettxOutput.recipient).toEqual(testAccount2); + }); }); describe('Record operations', () => {