Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forgot to emit first MinGasPrice event #134

Merged
merged 2 commits into from
Jan 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contracts/ExitHandler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ contract ExitHandler is DepositHandler {
initialize(_bridge);
exitDuration = _exitDuration;
exitStake = _exitStake;
emit MinGasPrice(0);
}

function setExitStake(uint256 _exitStake) public ifAdmin {
Expand Down
4 changes: 4 additions & 0 deletions contracts/mocks/TxMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ contract TxMock {
return TxLib.getSigHash(_txData);
}

function getUtxoId(uint256 _outputIndex, bytes32 _txHash) public pure returns (bytes32) {
return bytes32(uint256(_outputIndex) << 120 | uint120(uint256(_txHash)));
}

function flattenInput(TxLib.Input memory _input, uint256 _offset, bytes32[] memory _rsp) internal pure {
_rsp[_offset] = bytes32(_input.outpoint.hash);
_rsp[_offset + 1] = bytes32(uint256(_input.outpoint.pos));
Expand Down
3 changes: 3 additions & 0 deletions test/txLib.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ contract('TxLib', (accounts) => {

const rsp = await txLib.parse(proof).should.be.fulfilled;
checkParse(rsp, transfer);
const outpoint = transfer.inputs[0].prevout;
const utxoId = await txLib.getUtxoId(outpoint.index, `0x${outpoint.hash.toString('hex')}`);
assert.equal(utxoId, outpoint.getUtxoId());
});

it('should parse 2 inputs and 2 outputs', async () => {
Expand Down