From 72f61b557d09cb5f0b8e9ec924dde9bce435e2a7 Mon Sep 17 00:00:00 2001 From: Yoichi Hirai Date: Mon, 23 Sep 2019 16:27:52 +0200 Subject: [PATCH] Remove checks that are not in the onchain contract TokenNetworkRegistry.createERC20() succeeds even when the stored chain_id value is different from the current chain_id of the blockchain. Since the proxies should not check what's not checked onchain, I'm removing the checks that do not exist in the onchain contracts. --- raiden/network/proxies/token_network_registry.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/raiden/network/proxies/token_network_registry.py b/raiden/network/proxies/token_network_registry.py index 5922c6eb03..8250b8e610 100644 --- a/raiden/network/proxies/token_network_registry.py +++ b/raiden/network/proxies/token_network_registry.py @@ -174,12 +174,6 @@ def add_token( "The chain ID property for the TokenNetworkRegistry is invalid." ) - if chain_id != self.blockchain_service.network_id: - raise BrokenPreconditionError( - "The provided chain ID {chain_id} does not match the " - "network Raiden is running on: {self.blockchain_service.network_id}." - ) - if secret_registry_address == NULL_ADDRESS: raise BrokenPreconditionError( "The secret registry address for the token network is invalid." @@ -303,12 +297,6 @@ def _add_token( "The chain ID property for the TokenNetworkRegistry is invalid." ) - if chain_id != self.blockchain_service.network_id: - raise RaidenUnrecoverableError( - "The provided chain ID {chain_id} does not match the " - "network Raiden is running on: {self.blockchain_service.network_id}." - ) - if secret_registry_address == NULL_ADDRESS: raise RaidenUnrecoverableError( "The secret registry address for the token network is invalid."