forked from paritytech/txwrapper-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransfer.spec.ts
40 lines (33 loc) · 999 Bytes
/
transfer.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import {
itHasCorrectBaseTxInfo,
TEST_BASE_TX_INFO,
} from '@substrate/txwrapper-core';
import { MANDALA_602_TEST_OPTIONS, TEST_METHOD_ARGS } from '../../test-helpers';
import { transfer } from './transfer';
describe('currencies::transfer', () => {
it('should work', () => {
const unsigned = transfer(
TEST_METHOD_ARGS.currencies.transfer,
TEST_BASE_TX_INFO,
MANDALA_602_TEST_OPTIONS
);
itHasCorrectBaseTxInfo(unsigned);
expect(unsigned.method).toBe(
'0x0500ff8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48000030'
);
});
it('should accept big numbers as string', () => {
const unsigned = transfer(
{
...TEST_METHOD_ARGS.currencies.transfer,
amount: '9007199254740996', // MAX_SAFE_INTEGER + 5
},
TEST_BASE_TX_INFO,
MANDALA_602_TEST_OPTIONS
);
itHasCorrectBaseTxInfo(unsigned);
expect(unsigned.method).toBe(
'0x0500ff8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a4800000f04000000000020'
);
});
});