Skip to content

Commit

Permalink
Merge pull request #5 from ChorusOne/rm-unused-code
Browse files Browse the repository at this point in the history
Rm ssv contract address related code duplication
  • Loading branch information
mksh authored Sep 25, 2024
2 parents 2979b48 + 73a6706 commit 477de42
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions ssv_cluster_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ def __str__(self) -> str:

def ssv_network_views_contract(self) -> str:
# See https://docs.ssv.network/developers/smart-contracts
if self is self.MAINNET:
return "0xafE830B6Ee262ba11cce5F32fDCd760FFE6a66e4"
elif self is self.HOLESKY:
return "0x352A18AEe90cdcd825d1E37d9939dCA86C00e281"
else:
raise RuntimeError(
"Do not know SSV network views contract for this network"
)
match self.value:
case SupportedNetworks.HOLESKY:
return "0x38A4794cCEd47d3baf7370CcC43B560D3a1beEFA"
case SupportedNetworks.MAINNET:
return "0xafE830B6Ee262ba11cce5F32fDCd760FFE6a66e4"
raise RuntimeError("Can not derive SSV network views address for network")


# ###################
Expand Down Expand Up @@ -70,11 +68,7 @@ def get_ssv_network_views_contract(
web3: Web3, network: SupportedNetworks
) -> AsyncContract:
abi = get_ssv_network_views_contract_abi()
match network:
case SupportedNetworks.HOLESKY:
address = "0x38A4794cCEd47d3baf7370CcC43B560D3a1beEFA"
case SupportedNetworks.MAINNET:
address = "0xafE830B6Ee262ba11cce5F32fDCd760FFE6a66e4"
address = network.ssv_network_views_contract()
contract: AsyncContract = web3.eth.contract(address=address, abi=abi) # type: ignore[call-overload]
return contract

Expand Down

0 comments on commit 477de42

Please sign in to comment.