MCPcopy
hub / github.com/raiden-network/raiden / deploy_smoketest_contracts

Function deploy_smoketest_contracts

raiden/tests/utils/smoketest.py:135–234  ·  view source on GitHub ↗
(
    client: JSONRPCClient,
    chain_id: ChainID,
    contract_manager: ContractManager,
    token_address: AddressHex,
)

Source from the content-addressed store, hash-verified

133
134
135def 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(

Callers 1

setup_raidenFunction · 0.85

Calls 8

initMethod · 0.95
to_checksum_addressFunction · 0.90
ProxyManagerClass · 0.90
UserDepositClass · 0.90
is_tx_hash_bytesFunction · 0.90
_deploy_contractFunction · 0.85
_sync_nonceMethod · 0.80

Tested by

no test coverage detected