From b3f666279d67a9c63adfcd792e323350b210bdc2 Mon Sep 17 00:00:00 2001 From: Tanmay Date: Fri, 13 Sep 2024 12:42:29 -0400 Subject: [PATCH 1/6] add proto files --- pkg/chains/chains.go | 12 ++ pkg/chains/chains.pb.go | 189 +++++++++--------- .../zetacore/pkg/chains/chains.proto | 2 + 3 files changed, 110 insertions(+), 93 deletions(-) diff --git a/pkg/chains/chains.go b/pkg/chains/chains.go index da449af748..df06b544ff 100644 --- a/pkg/chains/chains.go +++ b/pkg/chains/chains.go @@ -169,6 +169,18 @@ var ( Name: "btc_testnet", } + BitcoinSignetTestnet = Chain{ + ChainName: ChainName_btc_signet_testnet, + ChainId: 18332, + Network: Network_btc, + NetworkType: NetworkType_testnet, + Vm: Vm_no_vm, + Consensus: Consensus_bitcoin, + IsExternal: true, + CctxGateway: CCTXGateway_observers, + Name: "btc_signet_testnet", + } + // Amoy is Polygon amoy testnet Amoy = Chain{ ChainName: ChainName_amoy_testnet, diff --git a/pkg/chains/chains.pb.go b/pkg/chains/chains.pb.go index 217ad55328..885f0acbbd 100644 --- a/pkg/chains/chains.pb.go +++ b/pkg/chains/chains.pb.go @@ -60,28 +60,29 @@ func (ReceiveStatus) EnumDescriptor() ([]byte, []int) { type ChainName int32 const ( - ChainName_empty ChainName = 0 - ChainName_eth_mainnet ChainName = 1 - ChainName_zeta_mainnet ChainName = 2 - ChainName_btc_mainnet ChainName = 3 - ChainName_polygon_mainnet ChainName = 4 - ChainName_bsc_mainnet ChainName = 5 - ChainName_goerli_testnet ChainName = 6 - ChainName_mumbai_testnet ChainName = 7 - ChainName_bsc_testnet ChainName = 10 - ChainName_zeta_testnet ChainName = 11 - ChainName_btc_testnet ChainName = 12 - ChainName_sepolia_testnet ChainName = 13 - ChainName_goerli_localnet ChainName = 14 - ChainName_btc_regtest ChainName = 15 - ChainName_amoy_testnet ChainName = 16 - ChainName_optimism_mainnet ChainName = 17 - ChainName_optimism_sepolia ChainName = 18 - ChainName_base_mainnet ChainName = 19 - ChainName_base_sepolia ChainName = 20 - ChainName_solana_mainnet ChainName = 21 - ChainName_solana_devnet ChainName = 22 - ChainName_solana_localnet ChainName = 23 + ChainName_empty ChainName = 0 + ChainName_eth_mainnet ChainName = 1 + ChainName_zeta_mainnet ChainName = 2 + ChainName_btc_mainnet ChainName = 3 + ChainName_polygon_mainnet ChainName = 4 + ChainName_bsc_mainnet ChainName = 5 + ChainName_goerli_testnet ChainName = 6 + ChainName_mumbai_testnet ChainName = 7 + ChainName_bsc_testnet ChainName = 10 + ChainName_zeta_testnet ChainName = 11 + ChainName_btc_testnet ChainName = 12 + ChainName_sepolia_testnet ChainName = 13 + ChainName_goerli_localnet ChainName = 14 + ChainName_btc_regtest ChainName = 15 + ChainName_amoy_testnet ChainName = 16 + ChainName_optimism_mainnet ChainName = 17 + ChainName_optimism_sepolia ChainName = 18 + ChainName_base_mainnet ChainName = 19 + ChainName_base_sepolia ChainName = 20 + ChainName_solana_mainnet ChainName = 21 + ChainName_solana_devnet ChainName = 22 + ChainName_solana_localnet ChainName = 23 + ChainName_btc_signet_testnet ChainName = 24 ) var ChainName_name = map[int32]string{ @@ -107,31 +108,33 @@ var ChainName_name = map[int32]string{ 21: "solana_mainnet", 22: "solana_devnet", 23: "solana_localnet", + 24: "btc_signet_testnet", } var ChainName_value = map[string]int32{ - "empty": 0, - "eth_mainnet": 1, - "zeta_mainnet": 2, - "btc_mainnet": 3, - "polygon_mainnet": 4, - "bsc_mainnet": 5, - "goerli_testnet": 6, - "mumbai_testnet": 7, - "bsc_testnet": 10, - "zeta_testnet": 11, - "btc_testnet": 12, - "sepolia_testnet": 13, - "goerli_localnet": 14, - "btc_regtest": 15, - "amoy_testnet": 16, - "optimism_mainnet": 17, - "optimism_sepolia": 18, - "base_mainnet": 19, - "base_sepolia": 20, - "solana_mainnet": 21, - "solana_devnet": 22, - "solana_localnet": 23, + "empty": 0, + "eth_mainnet": 1, + "zeta_mainnet": 2, + "btc_mainnet": 3, + "polygon_mainnet": 4, + "bsc_mainnet": 5, + "goerli_testnet": 6, + "mumbai_testnet": 7, + "bsc_testnet": 10, + "zeta_testnet": 11, + "btc_testnet": 12, + "sepolia_testnet": 13, + "goerli_localnet": 14, + "btc_regtest": 15, + "amoy_testnet": 16, + "optimism_mainnet": 17, + "optimism_sepolia": 18, + "base_mainnet": 19, + "base_sepolia": 20, + "solana_mainnet": 21, + "solana_devnet": 22, + "solana_localnet": 23, + "btc_signet_testnet": 24, } func (x ChainName) String() string { @@ -455,56 +458,56 @@ func init() { } var fileDescriptor_236b85e7bff6130d = []byte{ - // 770 bytes of a gzipped FileDescriptorProto + // 781 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x8e, 0xe4, 0x34, - 0x10, 0xee, 0x24, 0xfd, 0x5b, 0x3d, 0x3f, 0x5e, 0xef, 0x00, 0x61, 0x25, 0x9a, 0x01, 0x09, 0x68, - 0x8d, 0xa0, 0x47, 0xc0, 0x91, 0x03, 0x68, 0x47, 0x2c, 0x42, 0x88, 0x3d, 0x84, 0xd5, 0x0a, 0x71, - 0x69, 0xdc, 0xee, 0x22, 0x6d, 0x75, 0x6c, 0x47, 0xb1, 0x3b, 0xbb, 0xcd, 0x53, 0xf0, 0x10, 0x1c, - 0x90, 0x78, 0x11, 0x8e, 0x7b, 0xe4, 0x88, 0x66, 0x1e, 0x04, 0x64, 0xc7, 0x49, 0x0f, 0x97, 0x9d, - 0x39, 0xc5, 0xfe, 0xf2, 0x7d, 0x55, 0x5f, 0x55, 0xd9, 0x86, 0x8b, 0x5f, 0xd1, 0x32, 0xbe, 0x61, - 0x42, 0x5d, 0xfa, 0x95, 0xae, 0xf0, 0xb2, 0xdc, 0xe6, 0x97, 0x1e, 0x32, 0xe1, 0xb3, 0x28, 0x2b, - 0x6d, 0x35, 0x7d, 0xa7, 0xe3, 0x2e, 0x5a, 0xee, 0xa2, 0xdc, 0xe6,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0x22, 0x1d, 0x9d, 0x47, 0xf3, 0x71, 0x06, 0xc2, 0x7c, 0x15, + 0x10, 0x57, 0x2a, 0xe7, 0xf6, 0xd5, 0x32, 0x67, 0x16, 0x5f, 0xb2, 0x7d, 0x3a, 0xbe, 0x57, 0xa9, + 0x57, 0x57, 0xcf, 0x7f, 0xf8, 0xba, 0x51, 0x64, 0x53, 0xa7, 0x0f, 0x1b, 0x4a, 0xa1, 0xef, 0xaf, + 0x70, 0x72, 0x1e, 0xcd, 0x27, 0x99, 0x5f, 0x5f, 0x7c, 0x0e, 0xc7, 0x19, 0x72, 0x14, 0x35, 0x7e, + 0x6f, 0x99, 0xdd, 0x19, 0x3a, 0x85, 0x11, 0xaf, 0x90, 0x59, 0x5c, 0x93, 0x9e, 0xdb, 0x98, 0x1d, + 0xe7, 0x68, 0x0c, 0x89, 0x28, 0xc0, 0xf0, 0x67, 0x26, 0x0a, 0x5c, 0x93, 0xf8, 0x71, 0xff, 0xf7, + 0xdf, 0x66, 0xd1, 0xc5, 0x1f, 0x09, 0x4c, 0xba, 0x9b, 0xa6, 0x13, 0x18, 0xa0, 0x2c, 0xed, 0x9e, + 0xf4, 0xe8, 0x29, 0x4c, 0xd1, 0x6e, 0x96, 0x92, 0x09, 0xa5, 0xd0, 0x92, 0x88, 0x12, 0x38, 0x72, + 0x56, 0x3b, 0x24, 0x76, 0x94, 0x95, 0xe5, 0x1d, 0x90, 0xd0, 0x87, 0x70, 0x5a, 0xea, 0x62, 0x9f, + 0x6b, 0xd5, 0x81, 0x7d, 0xcf, 0x32, 0x07, 0xd6, 0x80, 0x52, 0x38, 0xc9, 0x35, 0x56, 0x85, 0x58, + 0x5a, 0x34, 0xd6, 0x61, 0x43, 0x87, 0xc9, 0x9d, 0x5c, 0xb1, 0x03, 0x36, 0x6a, 0x85, 0x2d, 0x00, + 0x9d, 0x83, 0x16, 0x99, 0xb6, 0x0e, 0x5a, 0xe0, 0xc8, 0x39, 0x30, 0x58, 0xea, 0x42, 0x1c, 0x58, + 0xc7, 0x0e, 0x0c, 0x09, 0x0b, 0xcd, 0x59, 0xe1, 0xc0, 0x93, 0x56, 0x5a, 0x61, 0xee, 0x88, 0xe4, + 0xd4, 0x45, 0x67, 0x52, 0xef, 0x3b, 0x1d, 0xa1, 0x67, 0x40, 0x74, 0x69, 0x85, 0x14, 0x46, 0x76, + 0xf6, 0x1f, 0xfc, 0x07, 0x0d, 0xb9, 0x08, 0x75, 0xea, 0x15, 0x33, 0xd8, 0xf1, 0x1e, 0x76, 0x48, + 0xcb, 0x39, 0x73, 0x45, 0x1a, 0x5d, 0x30, 0x75, 0x38, 0xc3, 0x37, 0xe8, 0x03, 0x38, 0x0e, 0xd8, + 0x1a, 0x6b, 0x07, 0x3d, 0xf2, 0x35, 0x34, 0x50, 0x67, 0xf7, 0x4d, 0xfa, 0x08, 0xa8, 0xb3, 0x6b, + 0x44, 0xae, 0xd0, 0x76, 0x1e, 0xd3, 0x70, 0x8b, 0x08, 0xa3, 0x30, 0x1d, 0x74, 0x04, 0x09, 0xda, + 0x0d, 0xe9, 0xd1, 0x31, 0xf4, 0xdd, 0x69, 0x91, 0xc8, 0x41, 0x2b, 0xcb, 0x49, 0xec, 0x7a, 0x21, + 0xdc, 0x0f, 0x49, 0x3c, 0x6a, 0x38, 0xe9, 0xd3, 0x23, 0x18, 0xb7, 0x05, 0x91, 0x81, 0x93, 0x39, + 0xdb, 0x64, 0xe8, 0x9a, 0xa5, 0xf1, 0x41, 0x46, 0x21, 0xcd, 0x53, 0x98, 0xde, 0x1a, 0x42, 0x17, + 0xae, 0x2d, 0xc4, 0xf7, 0x59, 0xeb, 0x2a, 0xf2, 0x89, 0x2a, 0x51, 0x37, 0x6d, 0x02, 0x30, 0x0c, + 0xb5, 0x25, 0x21, 0xce, 0x87, 0x10, 0xbf, 0x90, 0xae, 0xd9, 0x94, 0x5e, 0xd6, 0x92, 0xf4, 0xbc, + 0xe9, 0x5a, 0x36, 0x56, 0x4d, 0x2d, 0xbb, 0xee, 0xfc, 0x09, 0x26, 0xdd, 0xd8, 0x39, 0x9f, 0x68, + 0x37, 0x58, 0xe1, 0xce, 0x49, 0x4e, 0x00, 0x2c, 0xaa, 0x35, 0x56, 0x52, 0xa8, 0x90, 0x72, 0x25, + 0x2c, 0xd7, 0x42, 0x91, 0xb8, 0x29, 0x69, 0x69, 0x2c, 0xe3, 0x5b, 0x92, 0xb8, 0x1b, 0x0b, 0x07, + 0xda, 0x0d, 0x2e, 0xe9, 0x87, 0x0c, 0x1f, 0xc1, 0xf4, 0xd6, 0xb0, 0x35, 0x87, 0xe6, 0x2d, 0x1d, + 0xc3, 0x44, 0xaf, 0x0c, 0x56, 0x35, 0x56, 0x86, 0x44, 0x0d, 0xfb, 0xc9, 0x17, 0x7f, 0x5e, 0xcf, + 0xa2, 0xd7, 0xd7, 0xb3, 0xe8, 0xef, 0xeb, 0x59, 0xf4, 0xeb, 0xcd, 0xac, 0xf7, 0xfa, 0x66, 0xd6, + 0xfb, 0xeb, 0x66, 0xd6, 0xfb, 0xf1, 0xfd, 0x5c, 0xd8, 0xcd, 0x6e, 0xb5, 0xe0, 0x5a, 0xfa, 0x87, + 0xfe, 0xe3, 0xe6, 0xcd, 0x57, 0x7a, 0x7d, 0xfb, 0xbd, 0x5f, 0x0d, 0xfd, 0xa3, 0xfd, 0xd9, 0xbf, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x84, 0x13, 0xff, 0x06, 0x17, 0x06, 0x00, 0x00, } func (m *Chain) Marshal() (dAtA []byte, err error) { diff --git a/proto/zetachain/zetacore/pkg/chains/chains.proto b/proto/zetachain/zetacore/pkg/chains/chains.proto index 63b146cf42..40a420e007 100644 --- a/proto/zetachain/zetacore/pkg/chains/chains.proto +++ b/proto/zetachain/zetacore/pkg/chains/chains.proto @@ -48,6 +48,8 @@ enum ChainName { solana_mainnet = 21; solana_devnet = 22; solana_localnet = 23; + + btc_signet_testnet = 24; } // Network represents the network of the chain From f78f5cf279138b3a8c6c5e4a9c597fb65f1eb64b Mon Sep 17 00:00:00 2001 From: Tanmay Date: Mon, 16 Sep 2024 12:59:02 +0530 Subject: [PATCH 2/6] add unit tests for new chain --- pkg/chains/chain.go | 16 +++--- pkg/chains/chain_test.go | 113 ++++++++++++++++++++++++++++++++------- pkg/chains/chains.go | 2 +- 3 files changed, 105 insertions(+), 26 deletions(-) diff --git a/pkg/chains/chain.go b/pkg/chains/chain.go index bfd7398625..f5f6ee605d 100644 --- a/pkg/chains/chain.go +++ b/pkg/chains/chain.go @@ -167,12 +167,14 @@ func GetChainFromChainID(chainID int64, additionalChains []Chain) (Chain, bool) // GetBTCChainParams returns the bitcoin chain config params from the chain ID func GetBTCChainParams(chainID int64) (*chaincfg.Params, error) { switch chainID { - case 18444: + case BitcoinRegtest.ChainId: return &chaincfg.RegressionNetParams, nil - case 18332: + case BitcoinTestnet.ChainId: return &chaincfg.TestNet3Params, nil - case 8332: + case BitcoinMainnet.ChainId: return &chaincfg.MainNetParams, nil + case BitcoinSignetTestnet.ChainId: + return &chaincfg.SigNetParams, nil default: return nil, fmt.Errorf("error chainID %d is not a bitcoin chain", chainID) } @@ -182,11 +184,13 @@ func GetBTCChainParams(chainID int64) (*chaincfg.Params, error) { func GetBTCChainIDFromChainParams(params *chaincfg.Params) (int64, error) { switch params.Name { case chaincfg.RegressionNetParams.Name: - return 18444, nil + return BitcoinRegtest.ChainId, nil case chaincfg.TestNet3Params.Name: - return 18332, nil + return BitcoinTestnet.ChainId, nil case chaincfg.MainNetParams.Name: - return 8332, nil + return BitcoinMainnet.ChainId, nil + case chaincfg.SigNetParams.Name: + return BitcoinSignetTestnet.ChainId, nil default: return 0, fmt.Errorf("error chain %s is not a bitcoin chain", params.Name) } diff --git a/pkg/chains/chain_test.go b/pkg/chains/chain_test.go index d664e9c7fd..349651e7b9 100644 --- a/pkg/chains/chain_test.go +++ b/pkg/chains/chain_test.go @@ -241,6 +241,7 @@ func TestChain_IsBitcoinChain(t *testing.T) { {"Bitcoin Mainnet", chains.BitcoinMainnet, true}, {"Bitcoin Testnet", chains.BitcoinTestnet, true}, {"Bitcoin Regtest", chains.BitcoinRegtest, true}, + {"Bitcoin Signet Testnet", chains.BitcoinSignetTestnet, true}, {"Non-Bitcoin", chains.Ethereum, false}, {"Zeta Mainnet", chains.ZetaChainMainnet, false}, } @@ -350,6 +351,7 @@ func TestIsBitcoinChain(t *testing.T) { {"Bitcoin Mainnet", chains.BitcoinMainnet.ChainId, true}, {"Bitcoin Testnet", chains.BitcoinTestnet.ChainId, true}, {"Bitcoin Regtest", chains.BitcoinRegtest.ChainId, true}, + {"Bitcoin Signet Testnet", chains.BitcoinSignetTestnet.ChainId, true}, {"Non-Bitcoin", chains.Ethereum.ChainId, false}, {"Zeta Mainnet", chains.ZetaChainMainnet.ChainId, false}, } @@ -405,29 +407,102 @@ func TestGetChainFromChainID(t *testing.T) { } func TestGetBTCChainParams(t *testing.T) { - params, err := chains.GetBTCChainParams(chains.BitcoinMainnet.ChainId) - require.NoError(t, err) - require.Equal(t, &chaincfg.MainNetParams, params) + tt := []struct { + name string + chainID int64 + expectedParams *chaincfg.Params + expectedError require.ErrorAssertionFunc + }{ + { + name: "Bitcoin Mainnet", + chainID: chains.BitcoinMainnet.ChainId, + expectedParams: &chaincfg.MainNetParams, + expectedError: require.NoError, + }, + { + name: "Bitcoin Testnet", + chainID: chains.BitcoinTestnet.ChainId, + expectedParams: &chaincfg.TestNet3Params, + expectedError: require.NoError, + }, + { + name: "Bitcoin Regtest", + chainID: chains.BitcoinRegtest.ChainId, + expectedParams: &chaincfg.RegressionNetParams, + expectedError: require.NoError, + }, + { + name: "Bitcoin Signet Testnet", + chainID: chains.BitcoinSignetTestnet.ChainId, + expectedParams: &chaincfg.SigNetParams, + expectedError: require.NoError, + }, + { + name: "Unknown Chain", + chainID: 9999, + expectedParams: nil, + expectedError: func(t require.TestingT, err error, i ...interface{}) { + require.ErrorContains(t, err, "error chainID 9999 is not a bitcoin chain") + }, + }, + } + for _, tc := range tt { + t.Run(tc.name, func(t *testing.T) { + params, err := chains.GetBTCChainParams(tc.chainID) + tc.expectedError(t, err) + require.Equal(t, tc.expectedParams, params) + }) + } - _, err = chains.GetBTCChainParams(9999) - require.Error(t, err) } func TestGetBTCChainIDFromChainParams(t *testing.T) { - chainID, err := chains.GetBTCChainIDFromChainParams(&chaincfg.MainNetParams) - require.NoError(t, err) - require.Equal(t, int64(8332), chainID) - - chainID, err = chains.GetBTCChainIDFromChainParams(&chaincfg.RegressionNetParams) - require.NoError(t, err) - require.Equal(t, int64(18444), chainID) - - chainID, err = chains.GetBTCChainIDFromChainParams(&chaincfg.TestNet3Params) - require.NoError(t, err) - require.Equal(t, int64(18332), chainID) - - _, err = chains.GetBTCChainIDFromChainParams(&chaincfg.Params{Name: "unknown"}) - require.Error(t, err) + tt := []struct { + name string + params *chaincfg.Params + expectedChainID int64 + expectedError require.ErrorAssertionFunc + }{ + { + name: "Bitcoin Mainnet", + params: &chaincfg.MainNetParams, + expectedChainID: chains.BitcoinMainnet.ChainId, + expectedError: require.NoError, + }, + { + name: "Bitcoin Testnet", + params: &chaincfg.TestNet3Params, + expectedChainID: chains.BitcoinTestnet.ChainId, + expectedError: require.NoError, + }, + { + name: "Bitcoin Regtest", + params: &chaincfg.RegressionNetParams, + expectedChainID: chains.BitcoinRegtest.ChainId, + expectedError: require.NoError, + }, + { + name: "Bitcoin Signet Testnet", + params: &chaincfg.SigNetParams, + expectedChainID: chains.BitcoinSignetTestnet.ChainId, + expectedError: require.NoError, + }, + { + name: "Unknown Chain", + params: &chaincfg.Params{Name: "unknown"}, + expectedChainID: 0, + expectedError: func(t require.TestingT, err error, i ...interface{}) { + require.ErrorContains(t, err, "error chain unknown is not a bitcoin chain") + }, + }, + } + for _, tc := range tt { + t.Run(tc.name, func(t *testing.T) { + chainID, err := chains.GetBTCChainIDFromChainParams(tc.params) + tc.expectedError(t, err) + require.Equal(t, tc.expectedChainID, chainID) + }) + } } func TestChainIDInChainList(t *testing.T) { diff --git a/pkg/chains/chains.go b/pkg/chains/chains.go index df06b544ff..30918ca95a 100644 --- a/pkg/chains/chains.go +++ b/pkg/chains/chains.go @@ -171,7 +171,7 @@ var ( BitcoinSignetTestnet = Chain{ ChainName: ChainName_btc_signet_testnet, - ChainId: 18332, + ChainId: 001, Network: Network_btc, NetworkType: NetworkType_testnet, Vm: Vm_no_vm, From d77e208daf6cf21119f5a6e7693b5ddb19a3de75 Mon Sep 17 00:00:00 2001 From: Tanmay Date: Mon, 16 Sep 2024 14:45:40 +0530 Subject: [PATCH 3/6] add changelog --- changelog.md | 1 + zetaclient/config/types.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 0e51250604..fcc20c732f 100644 --- a/changelog.md +++ b/changelog.md @@ -19,6 +19,7 @@ * [2784](https://github.com/zeta-chain/node/pull/2784) - staking precompiled contract * [2795](https://github.com/zeta-chain/node/pull/2795) - support restricted address in Solana * [2861](https://github.com/zeta-chain/node/pull/2861) - emit events from staking precompile +* [2883](https://github.com/zeta-chain/node/pull/2883) - add chain static information for btc signet testnet ### Refactor diff --git a/zetaclient/config/types.go b/zetaclient/config/types.go index 4cafe0a9f7..4713aa7002 100644 --- a/zetaclient/config/types.go +++ b/zetaclient/config/types.go @@ -47,7 +47,7 @@ type BTCConfig struct { RPCUsername string RPCPassword string RPCHost string - RPCParams string // "regtest", "mainnet", "testnet3" + RPCParams string // "regtest", "mainnet", "testnet3" , "signet" } // SolanaConfig is the config for Solana chain From 151effc0d079a5671b7f5aff460cfce9fa007f30 Mon Sep 17 00:00:00 2001 From: Tanmay Date: Tue, 17 Sep 2024 12:48:10 +0530 Subject: [PATCH 4/6] refactor chain id for btc signet chain --- docs/openapi/openapi.swagger.yaml | 1 + pkg/chains/chains.go | 2 +- typescript/zetachain/zetacore/pkg/chains/chains_pb.d.ts | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/openapi/openapi.swagger.yaml b/docs/openapi/openapi.swagger.yaml index 819122175f..5c791c13a7 100644 --- a/docs/openapi/openapi.swagger.yaml +++ b/docs/openapi/openapi.swagger.yaml @@ -56983,6 +56983,7 @@ definitions: - solana_mainnet - solana_devnet - solana_localnet + - btc_signet_testnet default: empty title: |- ChainName represents the name of the chain diff --git a/pkg/chains/chains.go b/pkg/chains/chains.go index 30918ca95a..d988085c98 100644 --- a/pkg/chains/chains.go +++ b/pkg/chains/chains.go @@ -171,7 +171,7 @@ var ( BitcoinSignetTestnet = Chain{ ChainName: ChainName_btc_signet_testnet, - ChainId: 001, + ChainId: 18334, Network: Network_btc, NetworkType: NetworkType_testnet, Vm: Vm_no_vm, diff --git a/typescript/zetachain/zetacore/pkg/chains/chains_pb.d.ts b/typescript/zetachain/zetacore/pkg/chains/chains_pb.d.ts index af161efd7b..6aaa826636 100644 --- a/typescript/zetachain/zetacore/pkg/chains/chains_pb.d.ts +++ b/typescript/zetachain/zetacore/pkg/chains/chains_pb.d.ts @@ -148,6 +148,11 @@ export declare enum ChainName { * @generated from enum value: solana_localnet = 23; */ solana_localnet = 23, + + /** + * @generated from enum value: btc_signet_testnet = 24; + */ + btc_signet_testnet = 24, } /** From 62a3862dfc1c5e883864bef76abacb17744bb092 Mon Sep 17 00:00:00 2001 From: Tanmay Date: Tue, 17 Sep 2024 14:41:56 +0530 Subject: [PATCH 5/6] fix unit tests --- pkg/chains/chains.go | 1 + pkg/chains/chains_test.go | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/chains/chains.go b/pkg/chains/chains.go index d988085c98..bc2cea1ccf 100644 --- a/pkg/chains/chains.go +++ b/pkg/chains/chains.go @@ -359,6 +359,7 @@ func DefaultChainsList() []Chain { BscMainnet, Ethereum, BitcoinTestnet, + BitcoinSignetTestnet, Mumbai, Amoy, BscTestnet, diff --git a/pkg/chains/chains_test.go b/pkg/chains/chains_test.go index d6e1456434..b13c4b8a6b 100644 --- a/pkg/chains/chains_test.go +++ b/pkg/chains/chains_test.go @@ -42,6 +42,7 @@ func TestChainListByNetworkType(t *testing.T) { []chains.Chain{ chains.ZetaChainTestnet, chains.BitcoinTestnet, + chains.BitcoinSignetTestnet, chains.Mumbai, chains.Amoy, chains.BscTestnet, @@ -90,7 +91,7 @@ func TestChainListByNetwork(t *testing.T) { { "Btc", chains.Network_btc, - []chains.Chain{chains.BitcoinMainnet, chains.BitcoinTestnet, chains.BitcoinRegtest}, + []chains.Chain{chains.BitcoinMainnet, chains.BitcoinTestnet, chains.BitcoinSignetTestnet, chains.BitcoinRegtest}, }, { "Eth", @@ -137,6 +138,7 @@ func TestDefaultChainList(t *testing.T) { chains.BscMainnet, chains.Ethereum, chains.BitcoinTestnet, + chains.BitcoinSignetTestnet, chains.Mumbai, chains.Amoy, chains.BscTestnet, @@ -173,6 +175,7 @@ func TestChainListByGateway(t *testing.T) { chains.BscMainnet, chains.Ethereum, chains.BitcoinTestnet, + chains.BitcoinSignetTestnet, chains.Mumbai, chains.Amoy, chains.BscTestnet, @@ -215,6 +218,7 @@ func TestExternalChainList(t *testing.T) { chains.BscMainnet, chains.Ethereum, chains.BitcoinTestnet, + chains.BitcoinSignetTestnet, chains.Mumbai, chains.Amoy, chains.BscTestnet, From d8cb2f199e86595f5da873c0516bb1a20ce71c43 Mon Sep 17 00:00:00 2001 From: Tanmay Date: Tue, 17 Sep 2024 14:47:31 +0530 Subject: [PATCH 6/6] generate files 2 --- pkg/chains/chains_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/chains/chains_test.go b/pkg/chains/chains_test.go index b13c4b8a6b..5b5caf77cb 100644 --- a/pkg/chains/chains_test.go +++ b/pkg/chains/chains_test.go @@ -91,7 +91,12 @@ func TestChainListByNetwork(t *testing.T) { { "Btc", chains.Network_btc, - []chains.Chain{chains.BitcoinMainnet, chains.BitcoinTestnet, chains.BitcoinSignetTestnet, chains.BitcoinRegtest}, + []chains.Chain{ + chains.BitcoinMainnet, + chains.BitcoinTestnet, + chains.BitcoinSignetTestnet, + chains.BitcoinRegtest, + }, }, { "Eth",