Skip to content

Commit

Permalink
modify verification flags
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed Apr 26, 2024
1 parent 9fcaeef commit 00eec8e
Show file tree
Hide file tree
Showing 48 changed files with 1,959 additions and 1,121 deletions.
5 changes: 2 additions & 3 deletions e2e/txserver/zeta_tx_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,9 @@ func (zts ZetaTxServer) EnableVerificationFlags(account string) error {
return err
}

_, err = zts.BroadcastTx(account, lightclienttypes.NewMsgUpdateVerificationFlags(
_, err = zts.BroadcastTx(account, lightclienttypes.NewMsgEnableVerificationFlags(
addr.String(),
true,
true,
[]int64{chains.GoerliLocalnetChain.ChainId},
))

return err
Expand Down
242 changes: 113 additions & 129 deletions pkg/chains/chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,172 +21,156 @@ var (

// Mainnet chains
ZetaChainMainnet = Chain{
ChainName: ChainName_zeta_mainnet,
ChainId: 7000,
Network: Network_zeta,
NetworkType: NetworkType_mainnet,
Vm: Vm_evm,
Consensus: Consensus_tendermint,
IsExternal: false,
IsHeaderSupported: false,
ChainName: ChainName_zeta_mainnet,
ChainId: 7000,
Network: Network_zeta,
NetworkType: NetworkType_mainnet,
Vm: Vm_evm,
Consensus: Consensus_tendermint,
IsExternal: false,
}
EthChain = Chain{
ChainName: ChainName_eth_mainnet,
ChainId: 1,
Network: Network_eth,
NetworkType: NetworkType_mainnet,
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
IsHeaderSupported: true,
ChainName: ChainName_eth_mainnet,
ChainId: 1,
Network: Network_eth,
NetworkType: NetworkType_mainnet,
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
}
BscMainnetChain = Chain{
ChainName: ChainName_bsc_mainnet,
ChainId: 56,
Network: Network_bsc,
NetworkType: NetworkType_mainnet,
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
IsHeaderSupported: true,
ChainName: ChainName_bsc_mainnet,
ChainId: 56,
Network: Network_bsc,
NetworkType: NetworkType_mainnet,
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
}
BtcMainnetChain = Chain{
ChainName: ChainName_btc_mainnet,
ChainId: 8332,
Network: Network_btc,
NetworkType: NetworkType_mainnet,
Vm: Vm_no_vm,
Consensus: Consensus_bitcoin,
IsExternal: true,
IsHeaderSupported: false,
ChainName: ChainName_btc_mainnet,
ChainId: 8332,
Network: Network_btc,
NetworkType: NetworkType_mainnet,
Vm: Vm_no_vm,
Consensus: Consensus_bitcoin,
IsExternal: true,
}
PolygonChain = Chain{
ChainName: ChainName_polygon_mainnet,
ChainId: 137,
Network: Network_polygon,
NetworkType: NetworkType_mainnet,
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
IsHeaderSupported: false,
ChainName: ChainName_polygon_mainnet,
ChainId: 137,
Network: Network_polygon,
NetworkType: NetworkType_mainnet,
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
}
// Testnet chains
ZetaTestnetChain = Chain{
ChainName: ChainName_zeta_testnet,
ChainId: 7001,
Network: Network_zeta,
NetworkType: NetworkType_testnet,
Vm: Vm_evm,
Consensus: Consensus_tendermint,
IsExternal: false,
IsHeaderSupported: false,
ChainName: ChainName_zeta_testnet,
ChainId: 7001,
Network: Network_zeta,
NetworkType: NetworkType_testnet,
Vm: Vm_evm,
Consensus: Consensus_tendermint,
IsExternal: false,
}
SepoliaChain = Chain{
ChainName: ChainName_sepolia_testnet,
ChainId: 11155111,
Network: Network_eth,
NetworkType: NetworkType_testnet,
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
IsHeaderSupported: true,
ChainName: ChainName_sepolia_testnet,
ChainId: 11155111,
Network: Network_eth,
NetworkType: NetworkType_testnet,
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
}
BscTestnetChain = Chain{
ChainName: ChainName_bsc_testnet,
ChainId: 97,
Network: Network_bsc,
NetworkType: NetworkType_testnet,
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
IsHeaderSupported: true,
ChainName: ChainName_bsc_testnet,
ChainId: 97,
Network: Network_bsc,
NetworkType: NetworkType_testnet,
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
}
BtcTestNetChain = Chain{
ChainName: ChainName_btc_testnet,
ChainId: 18332,
Network: Network_btc,
NetworkType: NetworkType_testnet,
Vm: Vm_no_vm,
Consensus: Consensus_bitcoin,
IsExternal: true,
IsHeaderSupported: false,
ChainName: ChainName_btc_testnet,
ChainId: 18332,
Network: Network_btc,
NetworkType: NetworkType_testnet,
Vm: Vm_no_vm,
Consensus: Consensus_bitcoin,
IsExternal: true,
}

AmoyChain = Chain{
ChainName: ChainName_amoy_testnet,
ChainId: 80002,
Network: Network_polygon,
NetworkType: NetworkType_testnet,
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
IsHeaderSupported: false,
ChainName: ChainName_amoy_testnet,
ChainId: 80002,
Network: Network_polygon,
NetworkType: NetworkType_testnet,
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
}
// Devnet chains
ZetaMocknetChain = Chain{
ChainName: ChainName_zeta_mainnet,
ChainId: 70000,
Network: Network_zeta,
NetworkType: NetworkType_devnet,
Vm: Vm_evm,
Consensus: Consensus_tendermint,
IsExternal: false,
IsHeaderSupported: false,
ChainName: ChainName_zeta_mainnet,
ChainId: 70000,
Network: Network_zeta,
NetworkType: NetworkType_devnet,
Vm: Vm_evm,
Consensus: Consensus_tendermint,
IsExternal: false,
}
// Privnet chains
ZetaPrivnetChain = Chain{
ChainName: ChainName_zeta_mainnet,
ChainId: 101,
Network: Network_zeta,
NetworkType: NetworkType_privnet,
Vm: Vm_evm,
Consensus: Consensus_tendermint,
IsExternal: false,
IsHeaderSupported: false,
ChainName: ChainName_zeta_mainnet,
ChainId: 101,
Network: Network_zeta,
NetworkType: NetworkType_privnet,
Vm: Vm_evm,
Consensus: Consensus_tendermint,
IsExternal: false,
}

BtcRegtestChain = Chain{
ChainName: ChainName_btc_regtest,
ChainId: 18444,
Network: Network_btc,
NetworkType: NetworkType_privnet,
Vm: Vm_no_vm,
Consensus: Consensus_bitcoin,
IsExternal: true,
IsHeaderSupported: false,
ChainName: ChainName_btc_regtest,
ChainId: 18444,
Network: Network_btc,
NetworkType: NetworkType_privnet,
Vm: Vm_no_vm,
Consensus: Consensus_bitcoin,
IsExternal: true,
}

GoerliLocalnetChain = Chain{
ChainName: ChainName_goerli_localnet,
ChainId: 1337,
Network: Network_eth,
NetworkType: NetworkType_privnet,
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
IsHeaderSupported: true,
ChainName: ChainName_goerli_localnet,
ChainId: 1337,
Network: Network_eth,
NetworkType: NetworkType_privnet,
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
}

// Deprecated testnet chains
GoerliChain = Chain{
ChainName: ChainName_goerli_testnet,
ChainId: 5,
Network: Network_eth,
NetworkType: NetworkType_testnet,
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
IsHeaderSupported: true,
ChainName: ChainName_goerli_testnet,
ChainId: 5,
Network: Network_eth,
NetworkType: NetworkType_testnet,
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
}
MumbaiChain = Chain{
ChainName: ChainName_mumbai_testnet,
ChainId: 80001,
Network: Network_polygon,
NetworkType: NetworkType_testnet,
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
IsHeaderSupported: false,
ChainName: ChainName_mumbai_testnet,
ChainId: 80001,
Network: Network_polygon,
NetworkType: NetworkType_testnet,
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
}
)

Expand Down Expand Up @@ -264,7 +248,7 @@ func ChainListByConsensus(consensus Consensus) []*Chain {
func ChainListForHeaderSupport() []*Chain {
var chainList []*Chain
for _, chain := range DefaultChainsList() {
if chain.IsHeaderSupported {
if chain.Consensus == Consensus_ethereum {
chainList = append(chainList, chain)
}
}
Expand Down
Loading

0 comments on commit 00eec8e

Please sign in to comment.