Merge pull request #22 from harmony-one/return-interface
[harmony-account] make getBalance return Balance interface instead of objectpull/25/head
commit
0e1a4ba6e5
@ -0,0 +1,25 @@ |
||||
/** |
||||
* @packageDocumentation |
||||
* @module harmony-account |
||||
* @ignore |
||||
*/ |
||||
|
||||
import { Account } from '../src/account'; |
||||
import { HttpProvider, Messenger } from '@harmony-js/network'; |
||||
import { ChainType, ChainID } from '@harmony-js/utils'; |
||||
|
||||
const provider = new HttpProvider('http://localhost:9500'); |
||||
const messenger = new Messenger(provider, ChainType.Harmony, ChainID.HmyLocal); |
||||
|
||||
describe('test account', () => { |
||||
it('test Account.getBalance returns object that implements Balance interface', () => { |
||||
const acc = Account.new(); |
||||
acc.setMessenger(messenger); |
||||
acc.getBalance().then((res) => { |
||||
expect(res).not.toBeNull(); |
||||
expect(res.balance).not.toBeNull(); |
||||
expect(res.nonce).not.toBeNull(); |
||||
expect(res.shardID).not.toBeNull(); |
||||
}); |
||||
}); |
||||
}); |
Loading…
Reference in new issue