gettx test
All checks were successful
Lint / lint (18.x) (pull_request) Successful in 1m10s
Tests / cli_tests (18.x) (pull_request) Successful in 8m54s

This commit is contained in:
Thomas E Lackey 2024-08-19 22:00:05 -05:00
parent b0fd95cf11
commit 7708406771

View File

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