Skip to content

Commit

Permalink
Adding contract loader
Browse files Browse the repository at this point in the history
  • Loading branch information
smickovskid committed Oct 2, 2023
1 parent 026c6ae commit 850edbf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion integration-tests/contracts/contract_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type ContractLoader interface {
LoadWERC20Mock(addr common.Address) (WERC20Mock, error)
}

// NewContractLoader returns an instance of a contract Loader based on the client type
// NewContractLoader returnsa an instance of a contract Loader based on the client type
func NewContractLoader(bcClient blockchain.EVMClient, logger zerolog.Logger) (ContractLoader, error) {
switch clientImpl := bcClient.Get().(type) {
case *blockchain.EthereumClient:
Expand All @@ -56,6 +56,8 @@ func NewContractLoader(bcClient blockchain.EVMClient, logger zerolog.Logger) (Co
return &PolygonContractLoader{NewEthereumContractLoader(clientImpl, logger)}, nil
case *blockchain.OptimismClient:
return &OptimismContractLoader{NewEthereumContractLoader(clientImpl, logger)}, nil
case *blockchain.PolygonZkEvmClient:
return &PolygonZkEVMContractLoader{NewEthereumContractLoader(clientImpl, logger)}, nil
}
return nil, errors.New("unknown blockchain client implementation for contract Loader, register blockchain client in NewContractLoader")
}
Expand Down Expand Up @@ -86,6 +88,11 @@ type PolygonContractLoader struct {
*EthereumContractLoader
}

// PolygonZkEVMContractLoader wraps for Polygon
type PolygonZkEVMContractLoader struct {
*EthereumContractLoader
}

// OptimismContractLoader wraps for Optimism
type OptimismContractLoader struct {
*EthereumContractLoader
Expand Down

0 comments on commit 850edbf

Please sign in to comment.