|
1 | | -import { LumClient, LumWallet, LumConstants, LumMessages, LumUtils } from '../src'; |
| 1 | +import { LumWallet, LumConstants } from '../src'; |
2 | 2 |
|
3 | 3 | describe('LumClient', () => { |
4 | 4 | it('Should connect', async () => { |
5 | 5 | const w1 = await LumWallet.fromMnemonic('noodle hope lounge dismiss erase elephant seek crawl check equal city chest', LumConstants.getLumHdPath(0), 'cosmos'); |
6 | 6 | const w2 = await LumWallet.fromMnemonic('sick hollow lizard train motion eternal mixture rude section tray nice awful', LumConstants.getLumHdPath(0), 'cosmos'); |
| 7 | + expect(w1.address).not.toEqual(w2.address); |
7 | 8 |
|
8 | 9 | // Can connect to Cosmos testnet for compatibility checks: |
9 | 10 | // https://stargate.cosmos.network/testnet |
10 | | - const clt = await LumClient.connect('http://localhost:26657'); |
11 | | - console.log('wallet address', w1.address); |
12 | | - console.log('getChainId', await clt.getChainId()); |
13 | | - console.log('getBlockHeight', await clt.getBlockHeight()); |
14 | | - |
15 | | - console.log('getBlock', await clt.getBlock()); |
16 | | - |
17 | | - console.log('getAccount', await clt.getAccount(w1.address)); |
18 | | - console.log('getAccountUnverified', await clt.getAccountUnverified(w1.address)); |
19 | | - |
20 | | - console.log('getBalance', await clt.getBalance(w1.address, 'token')); |
21 | | - console.log('getBalancesUnverified', await clt.getBalancesUnverified(w1.address)); |
22 | | - |
23 | | - const txs = await clt.searchTx([LumUtils.searchTxFrom(w1.address), LumUtils.searchTxTo(w1.address)]); |
24 | | - console.log('getTx', await clt.getTx(txs[0].hash)); |
25 | | - console.log('searchTxs', txs); |
26 | | - |
27 | | - const sendMsg = LumMessages.BuildMsgSend(w1.address, w2.address, [{ denom: 'token', amount: '2' }]); |
28 | | - |
29 | | - const res = await clt.signAndBroadcastTx(w1, [sendMsg], { |
30 | | - amount: [ |
31 | | - { |
32 | | - denom: 'token', |
33 | | - amount: '1', |
34 | | - }, |
35 | | - ], |
36 | | - gas: '180000', // 180k |
37 | | - }); |
38 | | - console.log('signAndBroadcastTx', res); |
39 | | - console.log('getBalance(w1)', await clt.getBalance(w1.address, 'token')); |
40 | | - console.log('getBalance(w2)', await clt.getBalance(w2.address, 'token')); |
41 | | - |
| 11 | + // const clt = await LumClient.connect('http://localhost:26657'); |
| 12 | + // console.log('wallet address', w1.address); |
| 13 | + // console.log('getChainId', await clt.getChainId()); |
| 14 | + // console.log('getBlockHeight', await clt.getBlockHeight()); |
| 15 | + // console.log('getBlock', await clt.getBlock()); |
| 16 | + // console.log('getAccount', await clt.getAccount(w1.address)); |
| 17 | + // console.log('getAccountUnverified', await clt.getAccountUnverified(w1.address)); |
| 18 | + // console.log('getBalance', await clt.getBalance(w1.address, 'token')); |
| 19 | + // console.log('getBalancesUnverified', await clt.getBalancesUnverified(w1.address)); |
| 20 | + // const txs = await clt.searchTx([LumUtils.searchTxFrom(w1.address), LumUtils.searchTxTo(w1.address)]); |
| 21 | + // console.log('getTx', await clt.getTx(txs[0].hash)); |
| 22 | + // console.log('searchTxs', txs); |
| 23 | + // const sendMsg = LumMessages.BuildMsgSend(w1.address, w2.address, [{ denom: 'token', amount: '2' }]); |
| 24 | + // const res = await clt.signAndBroadcastTx(w1, [sendMsg], { |
| 25 | + // amount: [ |
| 26 | + // { |
| 27 | + // denom: 'token', |
| 28 | + // amount: '1', |
| 29 | + // }, |
| 30 | + // ], |
| 31 | + // gas: '180000', // 180k |
| 32 | + // }); |
| 33 | + // console.log('signAndBroadcastTx', res); |
| 34 | + // console.log('getBalance(w1)', await clt.getBalance(w1.address, 'token')); |
| 35 | + // console.log('getBalance(w2)', await clt.getBalance(w2.address, 'token')); |
42 | 36 | // WIP - needs to be automated through CICD |
43 | 37 | }); |
44 | 38 | }); |
0 commit comments