diff --git a/cadence/contracts/bridge/FlowEVMBridgeConfig.cdc b/cadence/contracts/bridge/FlowEVMBridgeConfig.cdc index eb553b5b..0d807951 100644 --- a/cadence/contracts/bridge/FlowEVMBridgeConfig.cdc +++ b/cadence/contracts/bridge/FlowEVMBridgeConfig.cdc @@ -229,18 +229,6 @@ contract FlowEVMBridgeConfig { ?? panic("Missing or mis-typed Blocklist in storage") } - /// Temporary method to initialize the EVMBlocklist resource as this resource was added after the contract was - /// deployed - /// - access(all) - fun initBlocklist() { - let path = /storage/evmBlocklist - if self.account.storage.type(at: path) != nil{ - return - } - self.account.storage.save(<-create EVMBlocklist(), to: path) - } - /***************** Constructs *****************/ @@ -508,5 +496,8 @@ contract FlowEVMBridgeConfig { self.account.storage.save(<-create Admin(), to: self.adminStoragePath) let adminCap = self.account.capabilities.storage.issue<&Admin>(self.adminStoragePath) self.account.capabilities.publish(adminCap, at: self.adminPublicPath) + + // Initialize the EVMBlocklist + self.account.storage.save(<-create EVMBlocklist(), to: /storage/evmBlocklist) } } diff --git a/cadence/tests/flow_evm_bridge_tests.cdc b/cadence/tests/flow_evm_bridge_tests.cdc index c2d27eec..12b61784 100644 --- a/cadence/tests/flow_evm_bridge_tests.cdc +++ b/cadence/tests/flow_evm_bridge_tests.cdc @@ -135,13 +135,6 @@ fun setup() { arguments: [] ) Test.expect(err, Test.beNil()) - // Initialize EVMBlocklist resource in account storage - let initBlocklistResult = executeTransaction( - "../transactions/bridge/admin/blocklist/init_blocklist.cdc", - [], - bridgeAccount - ) - Test.expect(initBlocklistResult, Test.beSucceeded()) // Deploy registry let registryDeploymentResult = executeTransaction( diff --git a/cadence/transactions/bridge/admin/blocklist/block_evm_address.cdc b/cadence/transactions/bridge/admin/blocklist/block_evm_address.cdc index 22a368df..a7607ea8 100644 --- a/cadence/transactions/bridge/admin/blocklist/block_evm_address.cdc +++ b/cadence/transactions/bridge/admin/blocklist/block_evm_address.cdc @@ -12,7 +12,6 @@ transaction(evmContractHex: String) { let evmAddress: EVM.EVMAddress prepare(signer: auth(BorrowValue) &Account) { - FlowEVMBridgeConfig.initBlocklist() self.evmBlocklist = signer.storage.borrow( from: /storage/evmBlocklist ) ?? panic("Could not borrow FlowEVMBridgeConfig Admin reference") diff --git a/cadence/transactions/bridge/admin/blocklist/init_blocklist.cdc b/cadence/transactions/bridge/admin/blocklist/init_blocklist.cdc deleted file mode 100644 index 4db39430..00000000 --- a/cadence/transactions/bridge/admin/blocklist/init_blocklist.cdc +++ /dev/null @@ -1,14 +0,0 @@ -import "EVM" - -import "FlowEVMBridgeConfig" - -/// Initializes the EVMBlocklist in the bridge account if it does not yet exist at the expected path -/// -transaction { - - prepare(signer: &Account) {} - - execute { - FlowEVMBridgeConfig.initBlocklist() - } -}