Skip to content

Commit

Permalink
refactor: adminWallet.test
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislavShevchenko committed Jan 17, 2020
1 parent 9f4cb16 commit 0cca09c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/server/blockchain/__tests__/adminWallet.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('adminwallet', () => {
const promises = []
for (let i = 0; i < 5; i++) {
const unverifiedAddress = generateWalletAddress()
// console.log('unverifiedAddress', unverifiedAddress)
const tx = await AdminWallet.whitelistUser(unverifiedAddress)
promises.push(AdminWallet.topWallet(unverifiedAddress))
}
const res = await Promise.all(promises).catch(_ => false)
Expand All @@ -57,12 +57,14 @@ describe('adminwallet', () => {

test('adminWallet bad transaction in queue', async () => {
const unverifiedAddress = generateWalletAddress()
const unverifiedAddress2 = generateWalletAddress()
const from = AdminWallet.address
const testValue = 10
const badGas = 10
let tx

//good tx
await AdminWallet.whitelistUser(unverifiedAddress)
tx = await AdminWallet.topWallet(unverifiedAddress)
expect(tx).toBeTruthy()

Expand All @@ -78,7 +80,8 @@ describe('adminwallet', () => {
).rejects.toThrow()

//good tx
tx = await AdminWallet.topWallet(unverifiedAddress)
await AdminWallet.whitelistUser(unverifiedAddress2)
tx = await AdminWallet.topWallet(unverifiedAddress2)
expect(tx).toBeTruthy()
})

Expand Down

0 comments on commit 0cca09c

Please sign in to comment.