927: Add gettx command and have send command return the tx hash. #78

Merged
telackey merged 4 commits from telackey/927 into main 2024-08-20 03:19:49 +00:00
Showing only changes of commit 7708406771 - Show all commits

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