-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge the develop branch to the master branch, preparation to v1.1.0 (#…
…238)
- Loading branch information
Showing
15 changed files
with
218 additions
and
12 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
COMMON_HOME_RPC_URL=http://parity1:8545 | ||
COMMON_FOREIGN_RPC_URL=http://parity2:8545 | ||
COMMON_HOME_BRIDGE_ADDRESS=0x0AEe1FCD12dDFab6265F7f8956e6E012A9Fe4Aa0 | ||
COMMON_FOREIGN_BRIDGE_ADDRESS=0x0AEe1FCD12dDFab6265F7f8956e6E012A9Fe4Aa0 | ||
MONITOR_HOME_START_BLOCK=0 | ||
MONITOR_FOREIGN_START_BLOCK=0 | ||
MONITOR_VALIDATOR_HOME_TX_LIMIT=300000 | ||
COMMON_HOME_GAS_PRICE_SUPPLIER_URL=https://gasprice.poa.network/ | ||
COMMON_HOME_GAS_PRICE_SPEED_TYPE=standard | ||
COMMON_HOME_GAS_PRICE_FALLBACK=1000000000 | ||
COMMON_HOME_GAS_PRICE_FACTOR=1 | ||
MONITOR_VALIDATOR_FOREIGN_TX_LIMIT=300000 | ||
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL=https://gasprice.poa.network/ | ||
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE=standard | ||
COMMON_FOREIGN_GAS_PRICE_FALLBACK=1000000000 | ||
COMMON_FOREIGN_GAS_PRICE_FACTOR=1 | ||
MONITOR_TX_NUMBER_THRESHOLD=100 | ||
MONITOR_PORT=3013 |
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
const assert = require('assert') | ||
const axios = require('axios') | ||
const { amb, user, foreignRPC, homeRPC, validator } = require('../../e2e-commons/constants.json') | ||
const { waitUntil, sendAMBMessage, addValidator } = require('../utils') | ||
|
||
const baseUrl = amb.monitor | ||
|
||
describe('AMB', () => { | ||
describe('balances', async () => { | ||
let data | ||
|
||
before(async () => { | ||
;({ data } = await axios.get(`${baseUrl}`)) | ||
}) | ||
|
||
describe('home', async () => { | ||
it('should contain toForeign:', () => assert(data.home.toForeign === 0)) | ||
it('should contain fromForeign', () => assert(data.home.fromForeign === 0)) | ||
}) | ||
|
||
describe('foreign', async () => { | ||
it('should contain fromHome:', () => assert(data.foreign.fromHome === 0)) | ||
it('should contain toHome', () => assert(data.foreign.toHome === 0)) | ||
}) | ||
|
||
describe('general', async () => { | ||
it('should contain fromHomeToForeignDiff', () => assert(data.fromHomeToForeignDiff === 0)) | ||
it('should contain fromForeignToHomeDiff', () => assert(data.fromForeignToHomeDiff === 0)) | ||
it('should contain lastChecked', () => assert(data.lastChecked >= 0)) | ||
it('should contain timeDiff', () => assert(data.timeDiff >= 0)) | ||
it('should contain lastChecked', () => assert(data.lastChecked >= 0)) | ||
}) | ||
}) | ||
describe('validators', async () => { | ||
let data | ||
|
||
before(async () => { | ||
;({ data } = await axios.get(`${baseUrl}/validators`)) | ||
}) | ||
|
||
it('home', () => { | ||
assert(typeof data.home.validators === 'object') | ||
assert(data.home.validators[validator.address].balance > 0) | ||
assert(data.home.validators[validator.address].leftTx > 0) | ||
assert(data.home.validators[validator.address].gasPrice > 0) | ||
}) | ||
|
||
it('foreign', () => { | ||
assert(typeof data.foreign.validators === 'object') | ||
assert(data.foreign.validators[validator.address].balance > 0) | ||
assert(data.foreign.validators[validator.address].leftTx > 0) | ||
assert(data.foreign.validators[validator.address].gasPrice > 0) | ||
}) | ||
|
||
it('requiredSignaturesMatch', () => assert(data.requiredSignaturesMatch, 1)) | ||
it('validatorsMatch', () => assert(data.validatorsMatch)) | ||
it('lastChecked', () => assert(data.lastChecked >= 0)) | ||
it('timeDiff', () => assert(data.timeDiff >= 0)) | ||
it('homeOk', () => assert(data.homeOk)) | ||
it('foreignOk', () => assert(data.foreignOk)) | ||
it('ok', () => assert(data.ok)) | ||
}) | ||
describe('eventsStats', async () => { | ||
let data | ||
|
||
before(async () => { | ||
;({ data } = await axios.get(`${baseUrl}/eventsStats`)) | ||
}) | ||
|
||
it('ok', () => assert(data.ok)) | ||
it('lastChecked', () => assert(data.lastChecked >= 0)) | ||
it('timeDiff', () => assert(data.timeDiff >= 0)) | ||
it('home-deliveredMsgNotProcessedInForeign', () => | ||
assert(typeof data.home.deliveredMsgNotProcessedInForeign === 'object')) | ||
it('home-processedMsgNotDeliveredInForeign', () => | ||
assert(typeof data.home.processedMsgNotDeliveredInForeign === 'object')) | ||
it('foreign-deliveredMsgNotProcessedInHome', () => | ||
assert(typeof data.foreign.deliveredMsgNotProcessedInHome === 'object')) | ||
it('foreign-processedMsgNotDeliveredInHome', () => | ||
assert(typeof data.foreign.processedMsgNotDeliveredInHome === 'object')) | ||
}) | ||
describe('alerts', async () => { | ||
let data | ||
|
||
before(async () => { | ||
;({ data } = await axios.get(`${baseUrl}/alerts`)) | ||
}) | ||
|
||
it('ok', () => assert(data.ok)) | ||
it('lastChecked', () => assert(data.lastChecked >= 0)) | ||
it('timeDiff', () => assert(data.timeDiff >= 0)) | ||
it('executeSignatures', () => assert(typeof data.executeSignatures === 'object')) | ||
it('executeAffirmations', () => assert(typeof data.executeAffirmations === 'object')) | ||
}) | ||
describe('changing state of contracts', () => { | ||
let data | ||
|
||
before(async () => { | ||
assert((await axios.get(`${baseUrl}/validators`)).data.validatorsMatch === true) | ||
}) | ||
|
||
it('should change fromForeignToHomeDiff', async () => { | ||
// send message | ||
await sendAMBMessage(foreignRPC.URL, user, amb.foreignBox, amb.foreign, amb.homeBox) | ||
|
||
await waitUntil(async () => { | ||
;({ data } = await axios.get(`${baseUrl}`)) | ||
return data.fromForeignToHomeDiff !== 0 | ||
}) | ||
}) | ||
it('should change fromHomeToForeignDiff', async () => { | ||
// send message | ||
await sendAMBMessage(homeRPC.URL, user, amb.homeBox, amb.home, amb.foreignBox) | ||
|
||
await waitUntil(async () => { | ||
;({ data } = await axios.get(`${baseUrl}`)) | ||
return data.fromHomeToForeignDiff !== 0 | ||
}) | ||
}) | ||
it('should change validatorsMatch', async () => { | ||
await addValidator(foreignRPC.URL, validator, amb.foreign) | ||
await waitUntil(async () => { | ||
;({ data } = await axios.get(`${baseUrl}/validators`)) | ||
return data.validatorsMatch === false | ||
}) | ||
}) | ||
}) | ||
}) |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Yarn: | ||
*/4 * * * * cd $HOME/bridge-monitor; yarn check-all >>cronWorker.out 2>>cronWorker.err | ||
*/4 * * * * cd $HOME/tokenbridge/monitor; yarn check-all >>cronWorker.out 2>>cronWorker.err | ||
|
||
# Docker: | ||
*/4 * * * * cd $HOME/bridge-monitor; docker-compose exec monitor yarn check-all >>cronWorker.out 2>>cronWorker.err | ||
*/4 * * * * cd $HOME/tokenbridge/monitor; docker-compose exec monitor yarn check-all >>cronWorker.out 2>>cronWorker.err |
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