From d26b447226fd40b767fd239759fc2195c82de55d Mon Sep 17 00:00:00 2001 From: charliec Date: Fri, 29 Sep 2023 17:05:03 -0500 Subject: [PATCH] workaround to build flags --- common/chain.go | 10 ++++++++++ zetaclient/evm_client.go | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/common/chain.go b/common/chain.go index 0952a64b49..210a96d1f4 100644 --- a/common/chain.go +++ b/common/chain.go @@ -124,6 +124,16 @@ func IsEthereumChain(chainID int64) bool { chainID == 1337 // eth privnet } +func IsBscChain(chainID int64) bool { + return chainID == 56 || // bsc mainnet + chainID == 97 // BSC testnet +} + +func IsPolygonChain(chainID int64) bool { + return chainID == 137 || // polygon mainnet + chainID == 80001 // polygon mumbai +} + // IsEmpty is to determinate whether the chain is empty func (chain Chain) IsEmpty() bool { return strings.TrimSpace(chain.String()) == "" diff --git a/zetaclient/evm_client.go b/zetaclient/evm_client.go index ad79f68d77..311b800aef 100644 --- a/zetaclient/evm_client.go +++ b/zetaclient/evm_client.go @@ -847,7 +847,7 @@ func (ob *EVMChainClient) observeInTX() error { continue } - if ob.chain.ChainId != common.MumbaiChain().ChainId { + if !common.IsPolygonChain(ob.chain.ChainId) { _, ballotIdentifier, err := ob.zetaClient.PostAddBlockHeader( ob.chain.ChainId, block.Hash().Bytes(),