From 134bf5a62073264115375d5e7bb68bfd8ffd6860 Mon Sep 17 00:00:00 2001 From: debris Date: Sun, 1 Oct 2017 19:16:44 +0200 Subject: [PATCH 1/2] fixed loading .bin files, filter topics and example gas amounts --- bridge/src/bridge/deploy.rs | 12 ++++++------ bridge/src/config.rs | 17 ++++++++++++----- bridge/src/error.rs | 3 ++- bridge/src/util.rs | 7 ++++++- contracts/Authorities.bin | 2 +- contracts/EthereumBridge.abi | 26 -------------------------- contracts/EthereumBridge.bin | 2 +- contracts/KovanBridge.bin | 2 +- contracts/Signer.abi | 1 + contracts/Signer.bin | 1 + contracts/SignerTest.abi | 25 +++++++++++++++++++++++++ contracts/SignerTest.bin | 1 + contracts/Utils.abi | 1 + contracts/Utils.bin | 1 + examples/config.toml | 9 ++++----- tests/tests/deposit_relay.rs | 16 ++++++++-------- tests/tests/withdraw_confirm.rs | 20 ++++++++++---------- tests/tests/withdraw_relay.rs | 12 ++++++------ tools/solc_compile.sh | 2 +- 19 files changed, 88 insertions(+), 72 deletions(-) create mode 100644 contracts/Signer.abi create mode 100644 contracts/Signer.bin create mode 100644 contracts/SignerTest.abi create mode 100644 contracts/SignerTest.bin create mode 100644 contracts/Utils.abi create mode 100644 contracts/Utils.bin diff --git a/bridge/src/bridge/deploy.rs b/bridge/src/bridge/deploy.rs index 49a3bf3b..8313874c 100644 --- a/bridge/src/bridge/deploy.rs +++ b/bridge/src/bridge/deploy.rs @@ -76,16 +76,16 @@ impl Future for Deploy { }; let main_future = api::send_transaction_with_confirmation( - self.app.connections.mainnet.clone(), - main_tx_request, - self.app.config.mainnet.poll_interval, + self.app.connections.mainnet.clone(), + main_tx_request, + self.app.config.mainnet.poll_interval, self.app.config.mainnet.required_confirmations ); let test_future = api::send_transaction_with_confirmation( - self.app.connections.testnet.clone(), - test_tx_request, - self.app.config.testnet.poll_interval, + self.app.connections.testnet.clone(), + test_tx_request, + self.app.config.testnet.poll_interval, self.app.config.testnet.required_confirmations ); diff --git a/bridge/src/config.rs b/bridge/src/config.rs index c2157fdd..4953d560 100644 --- a/bridge/src/config.rs +++ b/bridge/src/config.rs @@ -2,6 +2,7 @@ use std::path::{PathBuf, Path}; use std::fs; use std::io::Read; use std::time::Duration; +use rustc_hex::FromHex; use web3::types::{Address, Bytes}; use error::{ResultExt, Error}; use {toml}; @@ -62,7 +63,12 @@ impl Node { let result = Node { account: node.account, contract: ContractConfig { - bin: Bytes(fs::File::open(node.contract.bin)?.bytes().collect::>()?), + bin: { + let mut read = String::new(); + let mut file = fs::File::open(node.contract.bin)?; + file.read_to_string(&mut read)?; + Bytes(read.from_hex()?) + } }, ipc: node.ipc, request_timeout: Duration::from_secs(node.request_timeout.unwrap_or(DEFAULT_TIMEOUT)), @@ -182,6 +188,7 @@ mod load { #[cfg(test)] mod tests { use std::time::Duration; + use rustc_hex::FromHex; use super::{Config, Node, ContractConfig, Transactions, Authorities, TransactionConfig}; #[test] @@ -221,7 +228,7 @@ mainnet_deploy = { gas = 20 } account: "0x1B68Cb0B50181FC4006Ce572cF346e596E51818b".parse().unwrap(), ipc: "/mainnet.ipc".into(), contract: ContractConfig { - bin: include_bytes!("../../contracts/EthereumBridge.bin").to_vec().into(), + bin: include_str!("../../contracts/EthereumBridge.bin").from_hex().unwrap().into(), }, poll_interval: Duration::from_secs(2), request_timeout: Duration::from_secs(5), @@ -230,7 +237,7 @@ mainnet_deploy = { gas = 20 } testnet: Node { account: "0x0000000000000000000000000000000000000001".parse().unwrap(), contract: ContractConfig { - bin: include_bytes!("../../contracts/KovanBridge.bin").to_vec().into(), + bin: include_str!("../../contracts/KovanBridge.bin").from_hex().unwrap().into(), }, ipc: "/testnet.ipc".into(), poll_interval: Duration::from_secs(1), @@ -287,7 +294,7 @@ required_signatures = 2 account: "0x1B68Cb0B50181FC4006Ce572cF346e596E51818b".parse().unwrap(), ipc: "".into(), contract: ContractConfig { - bin: include_bytes!("../../contracts/EthereumBridge.bin").to_vec().into(), + bin: include_str!("../../contracts/EthereumBridge.bin").from_hex().unwrap().into(), }, poll_interval: Duration::from_secs(1), request_timeout: Duration::from_secs(5), @@ -297,7 +304,7 @@ required_signatures = 2 account: "0x0000000000000000000000000000000000000001".parse().unwrap(), ipc: "".into(), contract: ContractConfig { - bin: include_bytes!("../../contracts/KovanBridge.bin").to_vec().into(), + bin: include_str!("../../contracts/KovanBridge.bin").from_hex().unwrap().into(), }, poll_interval: Duration::from_secs(1), request_timeout: Duration::from_secs(5), diff --git a/bridge/src/error.rs b/bridge/src/error.rs index 289e1679..f95b5914 100644 --- a/bridge/src/error.rs +++ b/bridge/src/error.rs @@ -3,7 +3,7 @@ use std::io; use api::ApiCall; use tokio_timer::{TimerError, TimeoutError}; -use {web3, toml, ethabi}; +use {web3, toml, ethabi, rustc_hex}; error_chain! { types { @@ -15,6 +15,7 @@ error_chain! { Toml(toml::de::Error); Ethabi(ethabi::Error); Timer(TimerError); + Hex(rustc_hex::FromHexError); } errors { diff --git a/bridge/src/util.rs b/bridge/src/util.rs index eb9525ad..0004a7be 100644 --- a/bridge/src/util.rs +++ b/bridge/src/util.rs @@ -3,7 +3,12 @@ use ethabi; fn web3_topic(topic: ethabi::Topic) -> Option> { let t: Vec = topic.into(); - Some(t.into_iter().map(|x| H256(x)).collect()) + // parity does not conform to an ethereum spec + if t.is_empty() { + None + } else { + Some(t.into_iter().map(|x| H256(x)).collect()) + } } pub fn web3_filter(filter: ethabi::TopicFilter, address: Address) -> FilterBuilder { diff --git a/contracts/Authorities.bin b/contracts/Authorities.bin index df1fdc81..ca5f0b32 100644 --- a/contracts/Authorities.bin +++ b/contracts/Authorities.bin @@ -1 +1 @@ -60606040523415600e57600080fd5b5b603680601c6000396000f30060606040525b600080fd00a165627a7a72305820e26a7229ad87867b62326d8eecc9599e42fc23cf06ad9f6bb05c5c945b8e7f940029 \ No newline at end of file +60606040523415600e57600080fd5b603580601b6000396000f3006060604052600080fd00a165627a7a72305820c733ecef2aa1d616125ac7e6e57619bb9be23be96002392497d6de20de2eb7520029 \ No newline at end of file diff --git a/contracts/EthereumBridge.abi b/contracts/EthereumBridge.abi index a0112513..86690026 100644 --- a/contracts/EthereumBridge.abi +++ b/contracts/EthereumBridge.abi @@ -58,32 +58,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "constant": false, - "inputs": [ - { - "name": "v", - "type": "uint8[]" - }, - { - "name": "r", - "type": "bytes32[]" - }, - { - "name": "s", - "type": "bytes32[]" - }, - { - "name": "message", - "type": "bytes" - } - ], - "name": "reelect", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { diff --git a/contracts/EthereumBridge.bin b/contracts/EthereumBridge.bin index 7e992633..bb2e0ec5 100644 --- a/contracts/EthereumBridge.bin +++ b/contracts/EthereumBridge.bin @@ -1 +1 @@ -6060604052341561000f57600080fd5b604051610cae380380610cae833981016040528080519190602001805190910190505b81151561003e57600080fd5b805182111561004c57600080fd5b6000829055600181805161006492916020019061006d565b505b5050610100565b8280548282559060005260206000209081019282156100c4579160200282015b828111156100c45782518254600160a060020a031916600160a060020a03919091161782556020929092019160019091019061008d565b5b506100d19291506100d5565b5090565b6100fd91905b808211156100d1578054600160a060020a03191681556001016100db565b5090565b90565b610b9f8061010f6000396000f3006060604052361561005f5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663494503d481146100a75780638d068043146100d95780639ce318f6146100fe578063c3371af414610211575b5b7fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3334604051600160a060020a03909216825260208201526040908101905180910390a15b005b34156100b257600080fd5b6100bd600435610324565b604051600160a060020a03909116815260200160405180910390f35b34156100e457600080fd5b6100ec610356565b60405190815260200160405180910390f35b341561010957600080fd5b6100a56004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061035c95505050505050565b005b341561021c57600080fd5b6100a56004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496506106ef95505050505050565b005b600180548290811061033257fe5b906000526020600020900160005b915054906101000a9004600160a060020a031681565b60005481565b60008060008686868661036d610b04565b6000610377610b04565b60008060408051908101604052601a81527f19457468657265756d205369676e6564204d6573736167653a0a00000000000060208201529450848651876040518084805190602001908083835b602083106103e457805182525b601f1990920191602091820191016103c4565b6001836020036101000a038019825116818451161790925250505091909101848152602001905082805190602001908083835b6020831061043757805182525b601f199092019160209182019101610417565b6001836020036101000a03801982511681845116179092525050509190910194506040935050505051809103902093506000546040518059106104775750595b908082528060200260200182016040525b5092508851600054111561049b57600080fd5b600091505b60005482101561061b576001848a84815181106104b957fe5b906020019060200201518a85815181106104cf57fe5b906020019060200201518a86815181106104e557fe5b906020019060200201516040516000815260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f1151561054e57600080fd5b50506020604051035190506105c68160018054806020026020016040519081016040528092919081815260200182805480156105b357602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610595575b5050505050610a5490919063ffffffff16565b15156105d157600080fd5b6105e1838263ffffffff610a5416565b156105eb57600080fd5b808383815181106105f857fe5b600160a060020a039092166020928302909101909101525b6001909101906104a0565b8c519b5060328d01519a5060648d0151600081815260026020526040902054909a5060ff161561064a57600080fd5b60008a81526002602052604090819020805460ff19166001179055600160a060020a038d16908c156108fc02908d9051600060405180830381858888f19350505050151561069757600080fd5b7f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243648c8c604051600160a060020a03909216825260208201526040908101905180910390a15b5b50505050505050505050505050505050565b60008060008087878787610701610b04565b600061070b610b04565b60008060408051908101604052601a81527f19457468657265756d205369676e6564204d6573736167653a0a00000000000060208201529450848651876040518084805190602001908083835b6020831061077857805182525b601f199092019160209182019101610758565b6001836020036101000a038019825116818451161790925250505091909101848152602001905082805190602001908083835b602083106107cb57805182525b601f1990920191602091820191016107ab565b6001836020036101000a038019825116818451161790925250505091909101945060409350505050518091039020935060005460405180591061080b5750595b908082528060200260200182016040525b5092508851600054111561082f57600080fd5b600091505b6000548210156109af576001848a848151811061084d57fe5b906020019060200201518a858151811061086357fe5b906020019060200201518a868151811061087957fe5b906020019060200201516040516000815260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f115156108e257600080fd5b505060206040510351905061095a8160018054806020026020016040519081016040528092919081815260200182805480156105b357602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610595575b5050505050610a5490919063ffffffff16565b151561096557600080fd5b610975838263ffffffff610a5416565b1561097f57600080fd5b8083838151811061098c57fe5b600160a060020a039092166020928302909101909101525b600190910190610834565b8d519c5060328e01519b508b8d11156109c757600080fd5b6109d860018d63ffffffff610aae16565b600099505b8b8a1015610a3f5789603202606401808f01519b50508a60018b815481101515610a0357fe5b906000526020600020900160005b6101000a815481600160a060020a030219169083600160a060020a031602179055505b6001909901986109dd565b5b5b5050505050505050505050505050505050565b6000805b8351811015610aa25782600160a060020a0316848281518110610a7757fe5b90602001906020020151600160a060020a03161415610a995760019150610aa7565b5b600101610a58565b600091505b5092915050565b805b8254811015610af2578281815481101515610ac757fe5b906000526020600020900160005b6101000a815490600160a060020a0302191690555b600101610ab0565b81610afd8482610b28565b505b505050565b60206040519081016040526000815290565b60206040519081016040526000815290565b815481835581811511610aff57600083815260209020610aff918101908301610b52565b5b505050565b610b7091905b80821115610b6c5760008155600101610b58565b5090565b905600a165627a7a72305820a60dd57d592610f297deee331e56aa0bb71d6a42dae188060a71d89c94b99e5d0029 \ No newline at end of file +6060604052341561000f57600080fd5b604051610b92380380610b92833981016040528080519060200190919080518201919050506000821415151561004457600080fd5b8051821115151561005457600080fd5b816000819055508060019080519060200190610071929190610079565b505050610146565b8280548282559060005260206000209081019282156100f2579160200282015b828111156100f15782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190610099565b5b5090506100ff9190610103565b5090565b61014391905b8082111561013f57600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101610109565b5090565b90565b610a3d806101556000396000f30060606040523615610055576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063494503d4146100c25780638d068043146101255780639ce318f61461014e575b7fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3334604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1005b34156100cd57600080fd5b6100e3600480803590602001909190505061026b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561013057600080fd5b6101386102aa565b6040518082815260200191505060405180910390f35b341561015957600080fd5b610269600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506102b0565b005b60018181548110151561027a57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b60008060008686868660006102c36109d5565b6000806102cf85610638565b93506000546040518059106102e15750595b9080825280602002602001820160405250925087516000541115151561030657600080fd5b600091505b6000548210156104fe57600184898481518110151561032657fe5b90602001906020020151898581518110151561033e57fe5b90602001906020020151898681518110151561035657fe5b90602001906020020151604051600081526020016040526000604051602001526040518085600019166000191681526020018460ff1660ff16815260200183600019166000191681526020018260001916600019168152602001945050505050602060405160208103908084039060008661646e5a03f115156103d857600080fd5b505060206040510351905061047c81600180548060200260200160405190810160405280929190818152602001828054801561046957602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161041f575b505050505061079890919063ffffffff16565b151561048757600080fd5b61049a818461079890919063ffffffff16565b1515156104a657600080fd5b8083838151811015156104b557fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050818060010192505061030b565b60208c01519a5060408c0151995060608c01519850600260008a6000191660001916815260200190815260200160002060009054906101000a900460ff1615151561054857600080fd5b6001600260008b6000191660001916815260200190815260200160002060006101000a81548160ff0219169083151502179055508a73ffffffffffffffffffffffffffffffffffffffff166108fc8b9081150290604051600060405180830381858888f1935050505015156105bc57600080fd5b7f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243648b8b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1505050505050505050505050505050565b60006106426109e9565b6040805190810160405280601a81526020017f19457468657265756d205369676e6564204d6573736167653a0a0000000000008152509050806106858451610816565b846040518084805190602001908083835b6020831015156106bb5780518252602082019150602081019050602083039250610696565b6001836020036101000a03801982511681845116808217855250505050505090500183805190602001908083835b60208310151561070e57805182526020820191506020810190506020830392506106e9565b6001836020036101000a03801982511681845116808217855250505050505090500182805190602001908083835b602083101515610761578051825260208201915060208101905060208303925061073c565b6001836020036101000a03801982511681845116808217855250505050505090500193505050506040518091039020915050919050565b600080600090505b835181101561080a578273ffffffffffffffffffffffffffffffffffffffff1684828151811015156107ce57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614156107fd576001915061080f565b80806001019150506107a0565b600091505b5092915050565b61081e6109fd565b6108266109e9565b6000806108316109e9565b600060086040518059106108425750595b90808252806020026020018201604052509450600093505b6000871415156108f157600a8781151561087057fe5b069250600a8781151561087f57fe5b049650826030017f01000000000000000000000000000000000000000000000000000000000000000285858060010196508151811015156108bc57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061085a565b836040518059106108ff5750595b90808252806020026020018201604052509150600090505b838110156109c8578460018286030381518110151561093257fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002828281518110151561098b57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050610917565b8195505050505050919050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b6020604051908101604052806000815250905600a165627a7a7230582007d92199ccc35aa317b49b6eb0592a2469aabe3c420daa3e73db6e5ac4a38b860029 \ No newline at end of file diff --git a/contracts/KovanBridge.bin b/contracts/KovanBridge.bin index 9dccfa3e..9b47c412 100644 --- a/contracts/KovanBridge.bin +++ b/contracts/KovanBridge.bin @@ -1 +1 @@ -6060604052341561000f57600080fd5b604051610dcf380380610dcf833981016040528080519190602001805190910190505b81151561003e57600080fd5b805182111561004c57600080fd5b6000829055600181805161006492916020019061006d565b505b5050610100565b8280548282559060005260206000209081019282156100c4579160200282015b828111156100c45782518254600160a060020a031916600160a060020a03919091161782556020929092019160019091019061008d565b5b506100d19291506100d5565b5090565b6100fd91905b808211156100d1578054600160a060020a03191681556001016100db565b5090565b90565b610cc08061010f6000396000f3006060604052361561008b5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631812d996811461009057806326b3293f1461012157806327e235e314610148578063490a32c614610179578063494503d414610207578063630cea8e146102395780638d068043146102ce578063e1ad1162146102f3575b600080fd5b341561009b57600080fd5b6100a960043560243561031c565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100e65780820151818401525b6020016100cd565b50505050905090810190601f1680156101135780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561012c57600080fd5b610146600160a060020a03600435166024356044356103f2565b005b341561015357600080fd5b610167600160a060020a036004351661060a565b60405190815260200160405180910390f35b341561018457600080fd5b6100a960043561061c565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100e65780820151818401525b6020016100cd565b50505050905090810190601f1680156101135780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021257600080fd5b61021d6004356106db565b604051600160a060020a03909116815260200160405180910390f35b341561024457600080fd5b61014660046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061070d95505050505050565b005b34156102d957600080fd5b6101676109af565b60405190815260200160405180910390f35b34156102fe57600080fd5b610146600160a060020a036004351660243560443515156109b5565b005b610324610b1c565b600083815260046020526040902060020180548390811061034157fe5b906000526020600020900160005b508054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103e45780601f106103b9576101008083540402835291602001916103e4565b820191906000526020600020905b8154815290600101906020018083116103c757829003601f168201915b505050505090505b92915050565b600061046133600180548060200260200160405190810160405280929190818152602001828054801561044e57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610430575b5050505050610ac290919063ffffffff16565b151561046c57600080fd5b838383604051600160a060020a03939093166c01000000000000000000000000028352601483019190915260348201526054016040518091039020905061052f3360036000846000191660001916815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561044e57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610430575b5050505050610ac290919063ffffffff16565b1561053957600080fd5b60008181526003602052604090208054600181016105578382610b2e565b916000526020600020900160005b8154600160a060020a033381166101009390930a9283029202191617905550600080548282526003602052604090912054141561060257600160a060020a038416600090815260026020526040908190208054850190557fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c908590859051600160a060020a03909216825260208201526040908101905180910390a15b5b5b50505050565b60026020526000908152604090205481565b610624610b1c565b600082815260046020908152604091829020805490926002610100600184161502600019019092169190910491601f8301819004810201905190810160405280929190818152602001828054600181600116156101000203166002900480156106ce5780601f106106a3576101008083540402835291602001916106ce565b820191906000526020600020905b8154815290600101906020018083116106b157829003601f168201915b505050505090505b919050565b60018054829081106106e957fe5b906000526020600020900160005b915054906101000a9004600160a060020a031681565b600061077c33600180548060200260200160405190810160405280929190818152602001828054801561044e57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610430575b5050505050610ac290919063ffffffff16565b151561078757600080fd5b825160411461079557600080fd5b81516054146107a357600080fd5b816040518082805190602001908083835b602083106107d457805182525b601f1990920191602091820191016107b4565b6001836020036101000a03801982511681845116179092525050509190910192506040915050518091039020905061088b3360046000846000191660001916815260200190815260200160002060010180548060200260200160405190810160405280929190818152602001828054801561044e57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610430575b5050505050610ac290919063ffffffff16565b1561089557600080fd5b60008181526004602052604090208280516108b4929160200190610b58565b50600081815260046020526040902060019081018054909181016108d88382610b2e565b916000526020600020900160005b8154600160a060020a033381166101009390930a928302920219161790555060008181526004602052604090206002018054600181016109268382610bd7565b916000526020600020900160005b50848051610946929160200190610b58565b505060008054828252600460205260409091206001015414156109a8577feb043d149eedb81369bec43d4c3a3a53087debc88d2525f13bfaa3eecda28b5c3382604051600160a060020a03909216825260208201526040908101905180910390a15b5b5b505050565b60005481565b600160a060020a033316600090815260026020526040902054829010156109db57600080fd5b600160a060020a0333166000908152600260205260409020805483900390558015610a49577f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243648383604051600160a060020a03909216825260208201526040908101905180910390a16109a8565b600160a060020a038316600090815260026020526040908190208054840190557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9033908590859051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15b5b505050565b6000805b8351811015610b105782600160a060020a0316848281518110610ae557fe5b90602001906020020151600160a060020a03161415610b075760019150610b15565b5b600101610ac6565b600091505b5092915050565b60206040519081016040526000815290565b8154818355818115116109a8576000838152602090206109a8918101908301610c01565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610b9957805160ff1916838001178555610bc6565b82800160010185558215610bc6579182015b82811115610bc6578251825591602001919060010190610bab565b5b50610bd3929150610c01565b5090565b8154818355818115116109a8576000838152602090206109a8918101908301610c22565b5b505050565b610c1f91905b80821115610bd35760008155600101610c07565b5090565b90565b610c1f91905b80821115610bd3576000610c3c8282610c4c565b50600101610c28565b5090565b90565b50805460018160011615610100020316600290046000825580601f10610c725750610c90565b601f016020900490600052602060002090810190610c909190610c01565b5b505600a165627a7a723058206ec309794933245f7b7dfa758805fded4ebceccc858f59f1c7f5c4eb64da149a0029 \ No newline at end of file +606060405234156200001057600080fd5b604051620016a3380380620016a383398101604052808051906020019091908051820191905050600082141515156200004857600080fd5b805182111515156200005957600080fd5b8160008190555080600190805190602001906200007892919062000081565b50505062000156565b828054828255906000526020600020908101928215620000fd579160200282015b82811115620000fc5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190620000a2565b5b5090506200010c919062000110565b5090565b6200015391905b808211156200014f57600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555060010162000117565b5090565b90565b61153d80620001666000396000f3006060604052361561008c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631812d9961461009157806326b3293f1461013a57806327e235e314610189578063490a32c6146101d6578063494503d414610276578063630cea8e146102d95780638d06804314610379578063e1ad1162146103a2575b600080fd5b341561009c57600080fd5b6100bf6004808035600019169060200190919080359060200190919050506103ef565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100ff5780820151818401526020810190506100e4565b50505050905090810190601f16801561012c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014557600080fd5b610187600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035600019169060200190919050506104ce565b005b341561019457600080fd5b6101c0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610800565b6040518082815260200191505060405180910390f35b34156101e157600080fd5b6101fb600480803560001916906020019091905050610818565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561023b578082015181840152602081019050610220565b50505050905090810190601f1680156102685780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561028157600080fd5b61029760048080359060200190919050506108de565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102e457600080fd5b610377600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061091d565b005b341561038457600080fd5b61038c610cea565b6040518082815260200191505060405180910390f35b34156103ad57600080fd5b6103ed600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919080351515906020019091905050610cf0565b005b6103f7611378565b6004600084600019166000191681526020019081526020016000206002018281548110151561042257fe5b90600052602060002090018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104c15780601f10610496576101008083540402835291602001916104c1565b820191906000526020600020905b8154815290600101906020018083116104a457829003601f168201915b5050505050905092915050565b600061056933600180548060200260200160405190810160405280929190818152602001828054801561055657602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161050c575b5050505050610ef390919063ffffffff16565b151561057457600080fd5b838383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140183815260200182600019166000191681526020019350505050604051809103902090506106913360036000846000191660001916815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561067e57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610634575b5050505050610ef390919063ffffffff16565b15151561069d57600080fd5b60036000826000191660001916815260200190815260200160002080548060010182816106ca919061138c565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506000546003600083600019166000191681526020019081526020016000208054905014156107fa5782600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055507fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c8484604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b50505050565b60026020528060005260406000206000915090505481565b610820611378565b6004600083600019166000191681526020019081526020016000206000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108d25780601f106108a7576101008083540402835291602001916108d2565b820191906000526020600020905b8154815290600101906020018083116108b557829003601f168201915b50505050509050919050565b6001818154811015156108ed57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006109b83360018054806020026020016040519081016040528092919081815260200182805480156109a557602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161095b575b5050505050610ef390919063ffffffff16565b15156109c357600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166109e48484610f71565b73ffffffffffffffffffffffffffffffffffffffff16141515610a0657600080fd5b60548251141515610a1657600080fd5b816040518082805190602001908083835b602083101515610a4c5780518252602082019150602081019050602083039250610a27565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050610b3033600460008460001916600019168152602001908152602001600020600101805480602002602001604051908101604052809291908181526020018280548015610b1d57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610ad3575b5050505050610ef390919063ffffffff16565b151515610b3c57600080fd5b816004600083600019166000191681526020019081526020016000206000019080519060200190610b6e9291906113b8565b506004600082600019166000191681526020019081526020016000206001018054806001018281610b9f919061138c565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506004600082600019166000191681526020019081526020016000206002018054806001018281610c1e9190611438565b916000526020600020900160008590919091509080519060200190610c449291906113b8565b5050600054600460008360001916600019168152602001908152602001600020600101805490501415610ce5577feb043d149eedb81369bec43d4c3a3a53087debc88d2525f13bfaa3eecda28b5c3382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182600019166000191681526020019250505060405180910390a15b505050565b60005481565b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610d3e57600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508015610e01577f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243648383604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1610eee565b81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef338484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a15b505050565b600080600090505b8351811015610f65578273ffffffffffffffffffffffffffffffffffffffff168482815181101515610f2957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff161415610f585760019150610f6a565b8080600101915050610efb565b600091505b5092915050565b60008060008060418651141515610f8757600080fd5b6020860151925060408601519150606086015190506001610fa786611059565b827f010000000000000000000000000000000000000000000000000000000000000090048585604051600081526020016040526000604051602001526040518085600019166000191681526020018460ff1660ff16815260200183600019166000191681526020018260001916600019168152602001945050505050602060405160208103908084039060008661646e5a03f1151561104557600080fd5b505060206040510351935050505092915050565b6000611063611378565b6040805190810160405280601a81526020017f19457468657265756d205369676e6564204d6573736167653a0a0000000000008152509050806110a684516111b9565b846040518084805190602001908083835b6020831015156110dc57805182526020820191506020810190506020830392506110b7565b6001836020036101000a03801982511681845116808217855250505050505090500183805190602001908083835b60208310151561112f578051825260208201915060208101905060208303925061110a565b6001836020036101000a03801982511681845116808217855250505050505090500182805190602001908083835b602083101515611182578051825260208201915060208101905060208303925061115d565b6001836020036101000a03801982511681845116808217855250505050505090500193505050506040518091039020915050919050565b6111c1611464565b6111c9611378565b6000806111d4611378565b600060086040518059106111e55750595b90808252806020026020018201604052509450600093505b60008714151561129457600a8781151561121357fe5b069250600a8781151561122257fe5b049650826030017f010000000000000000000000000000000000000000000000000000000000000002858580600101965081518110151561125f57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506111fd565b836040518059106112a25750595b90808252806020026020018201604052509150600090505b8381101561136b57846001828603038151811015156112d557fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002828281518110151561132e57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806001019150506112ba565b8195505050505050919050565b602060405190810160405280600081525090565b8154818355818115116113b3578183600052602060002091820191016113b29190611478565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106113f957805160ff1916838001178555611427565b82800160010185558215611427579182015b8281111561142657825182559160200191906001019061140b565b5b5090506114349190611478565b5090565b81548183558181151161145f5781836000526020600020918201910161145e919061149d565b5b505050565b602060405190810160405280600081525090565b61149a91905b8082111561149657600081600090555060010161147e565b5090565b90565b6114c691905b808211156114c257600081816114b991906114c9565b506001016114a3565b5090565b90565b50805460018160011615610100020316600290046000825580601f106114ef575061150e565b601f01602090049060005260206000209081019061150d9190611478565b5b505600a165627a7a723058209b37f3287fffa6e4825c57a4e4d580210075de360a5c2d5d1cf89c2d565eddfc0029 \ No newline at end of file diff --git a/contracts/Signer.abi b/contracts/Signer.abi new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/contracts/Signer.abi @@ -0,0 +1 @@ +[] diff --git a/contracts/Signer.bin b/contracts/Signer.bin new file mode 100644 index 00000000..7a26a448 --- /dev/null +++ b/contracts/Signer.bin @@ -0,0 +1 @@ +60606040523415600e57600080fd5b603580601b6000396000f3006060604052600080fd00a165627a7a7230582010abed03fe6aaf49bc220a827f9623bba69e66c12cc9ff0cacca576d64435e8a0029 \ No newline at end of file diff --git a/contracts/SignerTest.abi b/contracts/SignerTest.abi new file mode 100644 index 00000000..9afb21e8 --- /dev/null +++ b/contracts/SignerTest.abi @@ -0,0 +1,25 @@ +[ + { + "constant": true, + "inputs": [ + { + "name": "signature", + "type": "bytes" + }, + { + "name": "message", + "type": "bytes" + } + ], + "name": "signer", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } +] diff --git a/contracts/SignerTest.bin b/contracts/SignerTest.bin new file mode 100644 index 00000000..daa45cdb --- /dev/null +++ b/contracts/SignerTest.bin @@ -0,0 +1 @@ +6060604052341561000f57600080fd5b6105818061001e6000396000f30060606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631c7ede5f1461003d57600080fd5b6100d0600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610112565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600061011e8383610126565b905092915050565b6000806000806041865114151561013c57600080fd5b602086015192506040860151915060608601519050600161015c8661020e565b827f010000000000000000000000000000000000000000000000000000000000000090048585604051600081526020016040526000604051602001526040518085600019166000191681526020018460ff1660ff16815260200183600019166000191681526020018260001916600019168152602001945050505050602060405160208103908084039060008661646e5a03f115156101fa57600080fd5b505060206040510351935050505092915050565b600061021861052d565b6040805190810160405280601a81526020017f19457468657265756d205369676e6564204d6573736167653a0a00000000000081525090508061025b845161036e565b846040518084805190602001908083835b602083101515610291578051825260208201915060208101905060208303925061026c565b6001836020036101000a03801982511681845116808217855250505050505090500183805190602001908083835b6020831015156102e457805182526020820191506020810190506020830392506102bf565b6001836020036101000a03801982511681845116808217855250505050505090500182805190602001908083835b6020831015156103375780518252602082019150602081019050602083039250610312565b6001836020036101000a03801982511681845116808217855250505050505090500193505050506040518091039020915050919050565b610376610541565b61037e61052d565b60008061038961052d565b6000600860405180591061039a5750595b90808252806020026020018201604052509450600093505b60008714151561044957600a878115156103c857fe5b069250600a878115156103d757fe5b049650826030017f010000000000000000000000000000000000000000000000000000000000000002858580600101965081518110151561041457fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506103b2565b836040518059106104575750595b90808252806020026020018201604052509150600090505b83811015610520578460018286030381518110151561048a57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f01000000000000000000000000000000000000000000000000000000000000000282828151811015156104e357fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350808060010191505061046f565b8195505050505050919050565b602060405190810160405280600081525090565b6020604051908101604052806000815250905600a165627a7a723058207b8a7203a547fd5753097cda5f928c1e787042c695f02c19fc78789fd45789800029 \ No newline at end of file diff --git a/contracts/Utils.abi b/contracts/Utils.abi new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/contracts/Utils.abi @@ -0,0 +1 @@ +[] diff --git a/contracts/Utils.bin b/contracts/Utils.bin new file mode 100644 index 00000000..c9f00590 --- /dev/null +++ b/contracts/Utils.bin @@ -0,0 +1 @@ +60606040523415600e57600080fd5b603580601b6000396000f3006060604052600080fd00a165627a7a72305820daa411d194914efc8a9b3681d5e8f795a940401e0a2d5ecb20e17c1036e123190029 \ No newline at end of file diff --git a/examples/config.toml b/examples/config.toml index 457aee2f..72125cb9 100644 --- a/examples/config.toml +++ b/examples/config.toml @@ -17,11 +17,10 @@ bin = "contracts/KovanBridge.bin" [authorities] accounts = [ "0x006e27b6a72e1f34c626762f3c4761547aff1421", - "0x006e27b6a72e1f34c626762f3c4761547aff1421", - "0x006e27b6a72e1f34c626762f3c4761547aff1421" ] -required_signatures = 2 +required_signatures = 1 [transactions] -mainnet_deploy = { gas = 500000 } -testnet_deploy = { gas = 500000 } +mainnet_deploy = { gas = 1000000 } +testnet_deploy = { gas = 3000000 } +deposit_relay = { gas = 100000 } diff --git a/tests/tests/deposit_relay.rs b/tests/tests/deposit_relay.rs index b2ce531e..64b85f99 100644 --- a/tests/tests/deposit_relay.rs +++ b/tests/tests/deposit_relay.rs @@ -28,13 +28,13 @@ test_app_stream! { req => r#"[]"#, res => r#""0x1011""#; "eth_getLogs" => - req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],[],[],[]]}]"#, + req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],null,null,null]}]"#, res => r#"[]"#; "eth_blockNumber" => req => r#"[]"#, res => r#""0x1012""#; "eth_getLogs" => - req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1006","limit":null,"toBlock":"0x1006","topics":[["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],[],[],[]]}]"#, + req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1006","limit":null,"toBlock":"0x1006","topics":[["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],null,null,null]}]"#, res => r#"[]"#; ], testnet_transport => [] @@ -66,13 +66,13 @@ test_app_stream! { req => r#"[]"#, res => r#""0x1011""#; "eth_getLogs" => - req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x6","limit":null,"toBlock":"0x1005","topics":[["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],[],[],[]]}]"#, + req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x6","limit":null,"toBlock":"0x1005","topics":[["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],null,null,null]}]"#, res => r#"[{"address":"0x0000000000000000000000000000000000000000","topics":["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],"data":"0x000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebcccc00000000000000000000000000000000000000000000000000000000000000f0","type":"","transactionHash":"0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"}]"#; "eth_blockNumber" => req => r#"[]"#, res => r#""0x1012""#; "eth_getLogs" => - req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1006","limit":null,"toBlock":"0x1006","topics":[["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],[],[],[]]}]"#, + req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1006","limit":null,"toBlock":"0x1006","topics":[["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],null,null,null]}]"#, res => r#"[]"#; ], testnet_transport => [ @@ -114,7 +114,7 @@ test_app_stream! { req => r#"[]"#, res => r#""0x1011""#; "eth_getLogs" => - req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x6","limit":null,"toBlock":"0x1005","topics":[["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],[],[],[]]}]"#, + req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x6","limit":null,"toBlock":"0x1005","topics":[["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],null,null,null]}]"#, res => r#"[{"address":"0x0000000000000000000000000000000000000000","topics":["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],"data":"0x000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebcccc00000000000000000000000000000000000000000000000000000000000000f0","type":"","transactionHash":"0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"}]"#; ], testnet_transport => [ @@ -151,7 +151,7 @@ test_app_stream! { req => r#"[]"#, res => r#""0x1011""#; "eth_getLogs" => - req => r#"[{"address":["0x0000000000000000000000000000000000000cc1"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],[],[],[]]}]"#, + req => r#"[{"address":["0x0000000000000000000000000000000000000cc1"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],null,null,null]}]"#, res => r#"[{"address":"0x0000000000000000000000000000000000000cc1","topics":["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],"data":"0x000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebcccc00000000000000000000000000000000000000000000000000000000000000f0","type":"","transactionHash":"0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"}]"#; ], testnet_transport => [ @@ -188,7 +188,7 @@ test_app_stream! { req => r#"[]"#, res => r#""0x1011""#; "eth_getLogs" => - req => r#"[{"address":["0x0000000000000000000000000000000000000cc1"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],[],[],[]]}]"#, + req => r#"[{"address":["0x0000000000000000000000000000000000000cc1"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],null,null,null]}]"#, res => r#"[{"address":"0x0000000000000000000000000000000000000cc1","topics":["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],"data":"0x000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebcccc00000000000000000000000000000000000000000000000000000000000000f0","type":"","transactionHash":"0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"}]"#; ], testnet_transport => [ @@ -221,7 +221,7 @@ test_app_stream! { req => r#"[]"#, res => r#""0x1011""#; "eth_getLogs" => - req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],[],[],[]]}]"#, + req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],null,null,null]}]"#, res => r#"[{"address":"0x0000000000000000000000000000000000000000","topics":["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],"data":"0x000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebcccc00000000000000000000000000000000000000000000000000000000000000f0","type":"","transactionHash":"0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"},{"address":"0x0000000000000000000000000000000000000000","topics":["0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c"],"data":"0x000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebcccc00000000000000000000000000000000000000000000000000000000000000f0","type":"","transactionHash":"0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436f"}]"#; ], testnet_transport => [ diff --git a/tests/tests/withdraw_confirm.rs b/tests/tests/withdraw_confirm.rs index b71be956..ac588453 100644 --- a/tests/tests/withdraw_confirm.rs +++ b/tests/tests/withdraw_confirm.rs @@ -29,13 +29,13 @@ test_app_stream! { req => r#"[]"#, res => r#""0x1011""#; "eth_getLogs" => - req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],[],[],[]]}]"#, + req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],null,null,null]}]"#, res => r#"[]"#; "eth_blockNumber" => req => r#"[]"#, res => r#""0x1012""#; "eth_getLogs" => - req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1006","limit":null,"toBlock":"0x1006","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],[],[],[]]}]"#, + req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1006","limit":null,"toBlock":"0x1006","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],null,null,null]}]"#, res => r#"[]"#; ] } @@ -70,13 +70,13 @@ test_app_stream! { req => r#"[]"#, res => r#""0x1011""#; "eth_getLogs" => - req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0xf6","limit":null,"toBlock":"0x1005","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],[],[],[]]}]"#, + req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0xf6","limit":null,"toBlock":"0x1005","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],null,null,null]}]"#, res => r#"[]"#; "eth_blockNumber" => req => r#"[]"#, res => r#""0x1012""#; "eth_getLogs" => - req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1006","limit":null,"toBlock":"0x1006","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],[],[],[]]}]"#, + req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1006","limit":null,"toBlock":"0x1006","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],null,null,null]}]"#, res => r#"[]"#; ] } @@ -113,13 +113,13 @@ test_app_stream! { req => r#"[]"#, res => r#""0x1011""#; "eth_getLogs" => - req => r#"[{"address":["0x49edf201c1e139282643d5e7c6fb0c7219ad1db8"],"fromBlock":"0xf6","limit":null,"toBlock":"0x1005","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],[],[],[]]}]"#, + req => r#"[{"address":["0x49edf201c1e139282643d5e7c6fb0c7219ad1db8"],"fromBlock":"0xf6","limit":null,"toBlock":"0x1005","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],null,null,null]}]"#, res => r#"[]"#; "eth_blockNumber" => req => r#"[]"#, res => r#""0x1012""#; "eth_getLogs" => - req => r#"[{"address":["0x49edf201c1e139282643d5e7c6fb0c7219ad1db8"],"fromBlock":"0x1006","limit":null,"toBlock":"0x1006","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],[],[],[]]}]"#, + req => r#"[{"address":["0x49edf201c1e139282643d5e7c6fb0c7219ad1db8"],"fromBlock":"0x1006","limit":null,"toBlock":"0x1006","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],null,null,null]}]"#, res => r#"[]"#; ] } @@ -162,7 +162,7 @@ test_app_stream! { req => r#"[]"#, res => r#""0x1011""#; "eth_getLogs" => - req => r#"[{"address":["0x49edf201c1e139282643d5e7c6fb0c7219ad1db8"],"fromBlock":"0xf6","limit":null,"toBlock":"0x1005","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],[],[],[]]}]"#, + req => r#"[{"address":["0x49edf201c1e139282643d5e7c6fb0c7219ad1db8"],"fromBlock":"0xf6","limit":null,"toBlock":"0x1005","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],null,null,null]}]"#, res => r#"[{"address":"0x49edf201c1e139282643d5e7c6fb0c7219ad1db8","topics":["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],"data":"0x000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebcccc00000000000000000000000000000000000000000000000000000000000000f0","type":"","transactionHash":"0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"}]"#; "eth_sign" => req => r#"["0x0000000000000000000000000000000000000001","0xaff3454fce5edbc8cca8697c15331677e6ebcccc00000000000000000000000000000000000000000000000000000000000000f0884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"]"#, @@ -174,7 +174,7 @@ test_app_stream! { req => r#"[]"#, res => r#""0x1012""#; "eth_getLogs" => - req => r#"[{"address":["0x49edf201c1e139282643d5e7c6fb0c7219ad1db8"],"fromBlock":"0x1006","limit":null,"toBlock":"0x1006","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],[],[],[]]}]"#, + req => r#"[{"address":["0x49edf201c1e139282643d5e7c6fb0c7219ad1db8"],"fromBlock":"0x1006","limit":null,"toBlock":"0x1006","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],null,null,null]}]"#, res => r#"[]"#; ] } @@ -213,7 +213,7 @@ test_app_stream! { req => r#"[]"#, res => r#""0xe""#; "eth_getLogs" => - req => r#"[{"address":["0x49edf201c1e139282643d5e7c6fb0c7219ad1db8"],"fromBlock":"0x1","limit":null,"toBlock":"0x2","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],[],[],[]]}]"#, + req => r#"[{"address":["0x49edf201c1e139282643d5e7c6fb0c7219ad1db8"],"fromBlock":"0x1","limit":null,"toBlock":"0x2","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],null,null,null]}]"#, res => r#"[{"address":"0x49edf201c1e139282643d5e7c6fb0c7219ad1db8","topics":["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],"data":"0x000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebcccc00000000000000000000000000000000000000000000000000000000000000f0","type":"","transactionHash":"0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"},{"address":"0x49edf201c1e139282643d5e7c6fb0c7219ad1db8","topics":["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],"data":"0x000000000000000000000000001da5bcab735024168f00b43abcc9ef522392e90000000000000000000000000000000000000000000000000000000000000099","type":"","transactionHash":"0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424399"}]"#; "eth_sign" => req => r#"["0x0000000000000000000000000000000000000001","0xaff3454fce5edbc8cca8697c15331677e6ebcccc00000000000000000000000000000000000000000000000000000000000000f0884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"]"#, @@ -231,7 +231,7 @@ test_app_stream! { req => r#"[]"#, res => r#""0x1012""#; "eth_getLogs" => - req => r#"[{"address":["0x49edf201c1e139282643d5e7c6fb0c7219ad1db8"],"fromBlock":"0x3","limit":null,"toBlock":"0x1006","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],[],[],[]]}]"#, + req => r#"[{"address":["0x49edf201c1e139282643d5e7c6fb0c7219ad1db8"],"fromBlock":"0x3","limit":null,"toBlock":"0x1006","topics":[["0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"],null,null,null]}]"#, res => r#"[]"#; ] } diff --git a/tests/tests/withdraw_relay.rs b/tests/tests/withdraw_relay.rs index 6aa0ff69..3a6a89fb 100644 --- a/tests/tests/withdraw_relay.rs +++ b/tests/tests/withdraw_relay.rs @@ -29,13 +29,13 @@ test_app_stream! { req => r#"[]"#, res => r#""0x1011""#; "eth_getLogs" => - req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0xeb043d149eedb81369bec43d4c3a3a53087debc88d2525f13bfaa3eecda28b5c"],[],[],[]]}]"#, + req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0xeb043d149eedb81369bec43d4c3a3a53087debc88d2525f13bfaa3eecda28b5c"],null,null,null]}]"#, res => r#"[]"#; "eth_blockNumber" => req => r#"[]"#, res => r#""0x1012""#; "eth_getLogs" => - req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1006","limit":null,"toBlock":"0x1006","topics":[["0xeb043d149eedb81369bec43d4c3a3a53087debc88d2525f13bfaa3eecda28b5c"],[],[],[]]}]"#, + req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1006","limit":null,"toBlock":"0x1006","topics":[["0xeb043d149eedb81369bec43d4c3a3a53087debc88d2525f13bfaa3eecda28b5c"],null,null,null]}]"#, res => r#"[]"#; ] } @@ -64,7 +64,7 @@ test_app_stream! { req => r#"[]"#, res => r#""0x1011""#; "eth_getLogs" => - req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0xeb043d149eedb81369bec43d4c3a3a53087debc88d2525f13bfaa3eecda28b5c"],[],[],[]]}]"#, + req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0xeb043d149eedb81369bec43d4c3a3a53087debc88d2525f13bfaa3eecda28b5c"],null,null,null]}]"#, res => r#"[{"address":"0x0000000000000000000000000000000000000000","topics":["0xeb043d149eedb81369bec43d4c3a3a53087debc88d2525f13bfaa3eecda28b5c"],"data":"0x000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebcccc00000000000000000000000000000000000000000000000000000000000000f0","type":"","transactionHash":"0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"}]"#; ] } @@ -97,7 +97,7 @@ test_app_stream! { req => r#"[]"#, res => r#""0x1011""#; "eth_getLogs" => - req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0xeb043d149eedb81369bec43d4c3a3a53087debc88d2525f13bfaa3eecda28b5c"],[],[],[]]}]"#, + req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0xeb043d149eedb81369bec43d4c3a3a53087debc88d2525f13bfaa3eecda28b5c"],null,null,null]}]"#, res => r#"[{"address":"0x0000000000000000000000000000000000000000","topics":["0xeb043d149eedb81369bec43d4c3a3a53087debc88d2525f13bfaa3eecda28b5c"],"data":"0x000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebcccc00000000000000000000000000000000000000000000000000000000000000f0","type":"","transactionHash":"0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"}]"#; "eth_call" => req => r#"[{"data":"0x490a32c600000000000000000000000000000000000000000000000000000000000000f0","to":"0x0000000000000000000000000000000000000000"},"latest"]"#, @@ -145,7 +145,7 @@ test_app_stream! { req => r#"[]"#, res => r#""0x1011""#; "eth_getLogs" => - req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0xeb043d149eedb81369bec43d4c3a3a53087debc88d2525f13bfaa3eecda28b5c"],[],[],[]]}]"#, + req => r#"[{"address":["0x0000000000000000000000000000000000000000"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0xeb043d149eedb81369bec43d4c3a3a53087debc88d2525f13bfaa3eecda28b5c"],null,null,null]}]"#, res => r#"[{"address":"0x0000000000000000000000000000000000000000","topics":["0xeb043d149eedb81369bec43d4c3a3a53087debc88d2525f13bfaa3eecda28b5c"],"data":"0x000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebcccc00000000000000000000000000000000000000000000000000000000000000f0","type":"","transactionHash":"0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"}]"#; "eth_call" => req => r#"[{"data":"0x490a32c600000000000000000000000000000000000000000000000000000000000000f0","to":"0x0000000000000000000000000000000000000000"},"latest"]"#, @@ -191,7 +191,7 @@ test_app_stream! { req => r#"[]"#, res => r#""0x1011""#; "eth_getLogs" => - req => r#"[{"address":["0x00000000000000000000000000000000000000ee"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0xeb043d149eedb81369bec43d4c3a3a53087debc88d2525f13bfaa3eecda28b5c"],[],[],[]]}]"#, + req => r#"[{"address":["0x00000000000000000000000000000000000000ee"],"fromBlock":"0x1","limit":null,"toBlock":"0x1005","topics":[["0xeb043d149eedb81369bec43d4c3a3a53087debc88d2525f13bfaa3eecda28b5c"],null,null,null]}]"#, res => r#"[{"address":"0x00000000000000000000000000000000000000ee","topics":["0xeb043d149eedb81369bec43d4c3a3a53087debc88d2525f13bfaa3eecda28b5c"],"data":"0x000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebcccc00000000000000000000000000000000000000000000000000000000000000f0","type":"","transactionHash":"0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364"}]"#; "eth_call" => req => r#"[{"data":"0x490a32c600000000000000000000000000000000000000000000000000000000000000f0","to":"0x00000000000000000000000000000000000000ee"},"latest"]"#, diff --git a/tools/solc_compile.sh b/tools/solc_compile.sh index 74473bcd..100053f2 100755 --- a/tools/solc_compile.sh +++ b/tools/solc_compile.sh @@ -1,7 +1,7 @@ #!/bin/bash cd contracts -solc --optimize --abi --bin -o . --overwrite bridge.sol +solc --abi --bin -o . --overwrite bridge.sol for abi in *.abi; do python -m json.tool "$abi" > tmp From 3fad3f47898a86d999f8a20fb9638aba482de747 Mon Sep 17 00:00:00 2001 From: viktor Date: Fri, 29 Sep 2017 18:25:22 -0700 Subject: [PATCH 2/2] README typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 896c52e9..401c8e88 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ testnet_deploy = { gas = 500000 } - `testnet.account` - authority address on the testnet (**required**) - `testnet.ipc` - path to testnet parity ipc handle (**required**) - `testnet.contract.bin` - path to the compiled bridge contract (**required**) -- `testnet.required_confirmations` - number of confirmation required to consider transaction final on testnte (default: **12**) +- `testnet.required_confirmations` - number of confirmation required to consider transaction final on testnet (default: **12**) - `testnet.poll_interval` - specify how often mainnet node should be polled for changes (in seconds, default: **1**) - `testnet.request_timeout` - specify request timeout (in seconds, default: **5**)