diff --git a/contracts/ExitHandler.sol b/contracts/ExitHandler.sol index aeda013..47d4092 100644 --- a/contracts/ExitHandler.sol +++ b/contracts/ExitHandler.sol @@ -171,6 +171,7 @@ contract ExitHandler is DepositHandler { initialize(_bridge); exitDuration = _exitDuration; exitStake = _exitStake; + emit MinGasPrice(0); } function setExitStake(uint256 _exitStake) public ifAdmin { diff --git a/contracts/mocks/TxMock.sol b/contracts/mocks/TxMock.sol index 297b881..512cb1f 100644 --- a/contracts/mocks/TxMock.sol +++ b/contracts/mocks/TxMock.sol @@ -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)); diff --git a/test/txLib.js b/test/txLib.js index e946de2..ce0259f 100644 --- a/test/txLib.js +++ b/test/txLib.js @@ -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 () => {