Skip to content

Commit

Permalink
test(account): spend with payload
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuk committed Apr 21, 2023
1 parent a7e9583 commit 68ccbae
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/integration/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
AeSdk, MemoryAccount,
generateKeyPair, AE_AMOUNT_FORMATS,
UnavailableAccountError, TypeError, ArgumentError, UnexpectedTsError,
encode, Encoding, Encoded,
} from '../../src';
import { Encoded } from '../../src/utils/encoder';

describe('Accounts', () => {
let aeSdk: AeSdk;
Expand Down Expand Up @@ -121,6 +121,12 @@ describe('Accounts', () => {
ret.tx.should.include({ amount: bigAmount, recipientId: publicKey });
});

it('spends with a payload', async () => {
const payload = encode(Buffer.from([1, 2, 3, 4]), Encoding.Bytearray);
const { tx } = await aeSdk.spend(1, receiver.address, { payload });
expect(tx?.payload).to.be.equal('ba_AQIDBI3kcuI=');
});

it('Get Account by block height/hash', async () => {
await aeSdk.awaitHeight(await aeSdk.getHeight() + 3);
const spend = await aeSdk.spend(123, 'ak_DMNCzsVoZnpV5fe8FTQnNsTfQ48YM5C3WbHPsJyHjAuTXebFi');
Expand Down

0 comments on commit 68ccbae

Please sign in to comment.