diff --git a/tests/test/addValidator.js b/tests/test/addValidator.js index c947d1d..e0423dc 100644 --- a/tests/test/addValidator.js +++ b/tests/test/addValidator.js @@ -1,7 +1,7 @@ const assert = require('assert') const { waitPromise, delay } = require('./utils/wait') -const { getBepBalance } = require('./utils/bncController') +const { getBepBalance, getBncFlags } = require('./utils/bncController') 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 () { this.timeout(120000) 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 () { diff --git a/tests/test/changeThreshold.js b/tests/test/changeThreshold.js index 1f6ee8b..fc0f357 100644 --- a/tests/test/changeThreshold.js +++ b/tests/test/changeThreshold.js @@ -1,7 +1,7 @@ const assert = require('assert') const { waitPromise, delay } = require('./utils/wait') -const { getBepBalance } = require('./utils/bncController') +const { getBepBalance, getBncFlags } = require('./utils/bncController') 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 () { this.timeout(120000) 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 () { diff --git a/tests/test/removeValidator.js b/tests/test/removeValidator.js index 1918346..befcede 100644 --- a/tests/test/removeValidator.js +++ b/tests/test/removeValidator.js @@ -1,7 +1,7 @@ const assert = require('assert') const { waitPromise, delay } = require('./utils/wait') -const { getBepBalance } = require('./utils/bncController') +const { getBepBalance, getBncFlags } = require('./utils/bncController') 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 () { this.timeout(120000) 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 () { diff --git a/tests/test/utils/bncController.js b/tests/test/utils/bncController.js index bb2ca86..93237d7 100644 --- a/tests/test/utils/bncController.js +++ b/tests/test/utils/bncController.js @@ -23,5 +23,9 @@ module.exports = { async getBncSequence(address) { const response = await retry(() => bnc.get(`/api/v1/account/${address}/sequence`)) return response ? response.data.sequence : 0 + }, + async getBncFlags(address) { + const response = await retry(() => bnc.get(`/api/v1/account/${address}`)) + return response.data.flags } }