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', () => {