Added additional checks for bnc account flags
This commit is contained in:
parent
fee494e677
commit
e04ddb94ca
|
@ -1,7 +1,7 @@
|
||||||
const assert = require('assert')
|
const assert = require('assert')
|
||||||
|
|
||||||
const { waitPromise, delay } = require('./utils/wait')
|
const { waitPromise, delay } = require('./utils/wait')
|
||||||
const { getBepBalance } = require('./utils/bncController')
|
const { getBepBalance, getBncFlags } = require('./utils/bncController')
|
||||||
|
|
||||||
const { controller1, controller3 } = require('./utils/proxyController')
|
const { controller1, controller3 } = require('./utils/proxyController')
|
||||||
|
|
||||||
|
@ -41,6 +41,8 @@ module.exports = (newValidator) => {
|
||||||
it('should finish close epoch process and start voting process', async function () {
|
it('should finish close epoch process and start voting process', async function () {
|
||||||
this.timeout(120000)
|
this.timeout(120000)
|
||||||
info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'voting')
|
info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'voting')
|
||||||
|
const flags = await getBncFlags(initialInfo.foreignBridgeAddress)
|
||||||
|
assert.strictEqual(flags, 1, 'Foreign bridge flags are not set correctly')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should add validator', async function () {
|
it('should add validator', async function () {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const assert = require('assert')
|
const assert = require('assert')
|
||||||
|
|
||||||
const { waitPromise, delay } = require('./utils/wait')
|
const { waitPromise, delay } = require('./utils/wait')
|
||||||
const { getBepBalance } = require('./utils/bncController')
|
const { getBepBalance, getBncFlags } = require('./utils/bncController')
|
||||||
|
|
||||||
const { controller1, controller2, controller3 } = require('./utils/proxyController')
|
const { controller1, controller2, controller3 } = require('./utils/proxyController')
|
||||||
|
|
||||||
|
@ -92,6 +92,8 @@ module.exports = (newThreshold) => {
|
||||||
it('should finish keygen process and start funds transfer', async function () {
|
it('should finish keygen process and start funds transfer', async function () {
|
||||||
this.timeout(120000)
|
this.timeout(120000)
|
||||||
info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'funds_transfer')
|
info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'funds_transfer')
|
||||||
|
const flags = await getBncFlags(initialInfo.foreignBridgeAddress)
|
||||||
|
assert.strictEqual(flags, 0, 'Foreign bridge flags are not set correctly')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should transfer all funds to new account and start new epoch', async function () {
|
it('should transfer all funds to new account and start new epoch', async function () {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const assert = require('assert')
|
const assert = require('assert')
|
||||||
|
|
||||||
const { waitPromise, delay } = require('./utils/wait')
|
const { waitPromise, delay } = require('./utils/wait')
|
||||||
const { getBepBalance } = require('./utils/bncController')
|
const { getBepBalance, getBncFlags } = require('./utils/bncController')
|
||||||
|
|
||||||
const { controller1, controller2, controller3 } = require('./utils/proxyController')
|
const { controller1, controller2, controller3 } = require('./utils/proxyController')
|
||||||
|
|
||||||
|
@ -41,6 +41,8 @@ module.exports = (oldValidator) => {
|
||||||
it('should finish close epoch process and start voting process', async function () {
|
it('should finish close epoch process and start voting process', async function () {
|
||||||
this.timeout(120000)
|
this.timeout(120000)
|
||||||
info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'voting')
|
info = await waitPromise(controller1.getInfo, (newInfo) => newInfo.bridgeStatus === 'voting')
|
||||||
|
const flags = await getBncFlags(initialInfo.foreignBridgeAddress)
|
||||||
|
assert.strictEqual(flags, 1, 'Foreign bridge flags are not set correctly')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should remove validator', async function () {
|
it('should remove validator', async function () {
|
||||||
|
|
|
@ -23,5 +23,9 @@ module.exports = {
|
||||||
async getBncSequence(address) {
|
async getBncSequence(address) {
|
||||||
const response = await retry(() => bnc.get(`/api/v1/account/${address}/sequence`))
|
const response = await retry(() => bnc.get(`/api/v1/account/${address}/sequence`))
|
||||||
return response ? response.data.sequence : 0
|
return response ? response.data.sequence : 0
|
||||||
|
},
|
||||||
|
async getBncFlags(address) {
|
||||||
|
const response = await retry(() => bnc.get(`/api/v1/account/${address}`))
|
||||||
|
return response.data.flags
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue