Skip to content

Commit

Permalink
Fix missing required block confirmation check in ForeignBridgeNative…
Browse files Browse the repository at this point in the history
…ToErc (#229)
  • Loading branch information
patitonar authored and akolotov committed Jul 12, 2019
1 parent 155f2e4 commit df1fa67
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ contract ForeignBridgeNativeToErc is ERC677Receiver, BasicForeignBridge, ERC677B
require(!isInitialized());
require(isContract(_validatorContract));
require(_minPerTx > 0 && _maxPerTx > _minPerTx && _dailyLimit > _maxPerTx);
require(_requiredBlockConfirmations > 0);
require(_foreignGasPrice > 0);
require(_homeMaxPerTx < _homeDailyLimit);
require(_owner != address(0));
Expand Down
14 changes: 14 additions & 0 deletions test/native_to_erc/foreign_bridge_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,20 @@ contract('ForeignBridge', async accounts => {
owner
)
.should.be.rejectedWith(ERROR_MSG)
await foreignBridge
.initialize(
validatorContract.address,
token.address,
oneEther,
halfEther,
minPerTx,
gasPrice,
0,
homeDailyLimit,
homeMaxPerTx,
owner
)
.should.be.rejectedWith(ERROR_MSG)
await foreignBridge.initialize(
validatorContract.address,
token.address,
Expand Down

0 comments on commit df1fa67

Please sign in to comment.