Fix amb subsidized mode tests in oracle-e2e

This commit is contained in:
Gerardo Nardelli 2019-08-22 17:22:49 -03:00
parent 065956e94e
commit 2357d787a6

@ -23,7 +23,7 @@ const foreignAMB = new foreignWeb3.eth.Contract(FOREIGN_AMB_ABI, amb.foreign)
const foreignBox = new foreignWeb3.eth.Contract(BOX_ABI, amb.foreignBox) const foreignBox = new foreignWeb3.eth.Contract(BOX_ABI, amb.foreignBox)
const oneEther = foreignWeb3.utils.toWei('1', 'ether') const oneEther = foreignWeb3.utils.toWei('1', 'ether')
const subsidizedHash = homeWeb3.utils.toBN(0) const subsidizedMode = homeWeb3.utils.toBN(0)
describe('arbitrary message bridging', () => { describe('arbitrary message bridging', () => {
describe('Home to Foreign', () => { describe('Home to Foreign', () => {
@ -155,8 +155,8 @@ describe('arbitrary message bridging', () => {
}) })
const foreignMode = await foreignAMB.methods.homeToForeignMode().call() const foreignMode = await foreignAMB.methods.homeToForeignMode().call()
assert(homeMode === subsidizedHash, 'home mode incorrect') assert(homeMode.eq(subsidizedMode), 'home mode incorrect')
assert(foreignMode === subsidizedHash, 'foreign mode incorrect') assert(foreignMode.eq(subsidizedMode), 'foreign mode incorrect')
const initialValue = await foreignBox.methods.value().call() const initialValue = await foreignBox.methods.value().call()
assert(!toBN(initialValue).eq(toBN(newValue)), 'initial value should be different from new value') assert(!toBN(initialValue).eq(toBN(newValue)), 'initial value should be different from new value')
@ -298,8 +298,8 @@ describe('arbitrary message bridging', () => {
const foreignMode = await foreignAMB.methods.foreignToHomeMode().call() const foreignMode = await foreignAMB.methods.foreignToHomeMode().call()
assert(homeMode === subsidizedHash, 'home mode incorrect') assert(homeMode.eq(subsidizedMode), 'home mode incorrect')
assert(foreignMode === subsidizedHash, 'foreign mode incorrect') assert(foreignMode.eq(subsidizedMode), 'foreign mode incorrect')
const initialValue = await homeBox.methods.value().call() const initialValue = await homeBox.methods.value().call()
assert(!toBN(initialValue).eq(toBN(newValue)), 'initial value should be different from new value') assert(!toBN(initialValue).eq(toBN(newValue)), 'initial value should be different from new value')