(
client: JSONRPCClient,
chain_id: ChainID,
contract_manager: ContractManager,
token_address: AddressHex,
)
| 133 | |
| 134 | |
| 135 | def deploy_smoketest_contracts( |
| 136 | client: JSONRPCClient, |
| 137 | chain_id: ChainID, |
| 138 | contract_manager: ContractManager, |
| 139 | token_address: AddressHex, |
| 140 | ) -> Dict[str, Address]: |
| 141 | if client.eth_node is EthClient.GETH: |
| 142 | client.web3.geth.personal.unlockAccount(client.web3.eth.accounts[0], DEFAULT_PASSPHRASE) |
| 143 | elif client.eth_node is EthClient.PARITY: |
| 144 | client.web3.parity.personal.unlockAccount(client.web3.eth.accounts[0], DEFAULT_PASSPHRASE) |
| 145 | |
| 146 | gas_price = 2 |
| 147 | gas_limit = 7_000_000 |
| 148 | deployer = ContractDeployer( |
| 149 | client.web3, client.privkey, gas_limit=gas_limit, gas_price=gas_price |
| 150 | ) |
| 151 | secret_registry_address = _deploy_contract(deployer, CONTRACT_SECRET_REGISTRY, []) |
| 152 | |
| 153 | token_network_registry_address = _deploy_contract( |
| 154 | deployer, |
| 155 | CONTRACT_TOKEN_NETWORK_REGISTRY, |
| 156 | [ |
| 157 | to_checksum_address(secret_registry_address), |
| 158 | TEST_SETTLE_TIMEOUT_MIN, |
| 159 | TEST_SETTLE_TIMEOUT_MAX, |
| 160 | UINT256_MAX, |
| 161 | ], |
| 162 | ) |
| 163 | |
| 164 | service_registry_address = _deploy_contract( |
| 165 | deployer, |
| 166 | CONTRACT_SERVICE_REGISTRY, |
| 167 | args=[ |
| 168 | token_address, |
| 169 | EMPTY_ADDRESS, |
| 170 | int(500e18), |
| 171 | 6, |
| 172 | 5, |
| 173 | 180 * SECONDS_PER_DAY, |
| 174 | 1000, |
| 175 | 200 * SECONDS_PER_DAY, |
| 176 | ], |
| 177 | ) |
| 178 | |
| 179 | user_deposit_address = _deploy_contract( |
| 180 | deployer, CONTRACT_USER_DEPOSIT, args=[token_address, UINT256_MAX] |
| 181 | ) |
| 182 | monitoring_service_address = _deploy_contract( |
| 183 | deployer, |
| 184 | CONTRACT_MONITORING_SERVICE, |
| 185 | args=[ |
| 186 | token_address, |
| 187 | service_registry_address, |
| 188 | user_deposit_address, |
| 189 | token_network_registry_address, |
| 190 | ], |
| 191 | ) |
| 192 | one_to_n_address = _deploy_contract( |
no test coverage detected