Created
April 28, 2020 15:01
-
-
Save tonyofbyteball/11d5083174cabdbfc8a9fd4a98aa6de3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') | |
// eslint-disable-next-line no-unused-vars | |
const { Testkit, Utils } = require('aa-testkit') | |
const { Network } = Testkit({ | |
TESTDATA_DIR: path.join(__dirname, '../testdata'), | |
}) | |
describe('Check 2 wallets', function () { | |
this.timeout(120 * 1000) | |
before(async () => { | |
this.network = await Network.create() | |
.with.wallet({ alice: 100e9 }) | |
.with.wallet({ bob: 100e9 }) | |
.run() | |
this.alice = this.network.wallet.alice | |
this.aliceAddress = await this.alice.getAddress() | |
this.bob = this.network.wallet.bob | |
this.bobAddress = await this.bob.getAddress() | |
const aliceBalance = await this.alice.getBalance() | |
console.log('alice', aliceBalance) | |
expect(aliceBalance.base.stable).to.be.equal(100e9) | |
const bobBalance = await this.bob.getBalance() | |
console.log('bob', bobBalance) | |
expect(bobBalance.base.stable).to.be.equal(100e9) | |
}) | |
it('Bob pays to Alice', async () => { | |
const { unit, error } = await this.bob.sendBytes({ | |
toAddress: this.aliceAddress, | |
amount: 1000, | |
}) | |
expect(error).to.be.null | |
expect(unit).to.be.validUnit | |
}) | |
after(async () => { | |
// uncomment this line to pause test execution to get time for Obyte DAG explorer inspection | |
// await Utils.sleep(3600 * 1000) | |
await this.network.stop() | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment