Skip to content

Commit

Permalink
remove FlowEVMBridgeConfig.initBlocklist()
Browse files Browse the repository at this point in the history
  • Loading branch information
sisyphusSmiling committed Sep 19, 2024
1 parent aea1fbb commit 77d0e6e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 34 deletions.
15 changes: 3 additions & 12 deletions cadence/contracts/bridge/FlowEVMBridgeConfig.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -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
*****************/
Expand Down Expand Up @@ -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)
}
}
7 changes: 0 additions & 7 deletions cadence/tests/flow_evm_bridge_tests.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ transaction(evmContractHex: String) {
let evmAddress: EVM.EVMAddress

prepare(signer: auth(BorrowValue) &Account) {
FlowEVMBridgeConfig.initBlocklist()
self.evmBlocklist = signer.storage.borrow<auth(FlowEVMBridgeConfig.Blocklist) &FlowEVMBridgeConfig.EVMBlocklist>(
from: /storage/evmBlocklist
) ?? panic("Could not borrow FlowEVMBridgeConfig Admin reference")
Expand Down
14 changes: 0 additions & 14 deletions cadence/transactions/bridge/admin/blocklist/init_blocklist.cdc

This file was deleted.

0 comments on commit 77d0e6e

Please sign in to comment.