Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Bitcoin Testnet4 static chain info #2911

Merged
merged 7 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* [2861](https://github.com/zeta-chain/node/pull/2861) - emit events from staking precompile
* [2870](https://github.com/zeta-chain/node/pull/2870) - support for multiple Bitcoin chains in the zetaclient
* [2883](https://github.com/zeta-chain/node/pull/2883) - add chain static information for btc signet testnet
* [2911](https://github.com/zeta-chain/node/pull/2911) - add chain static information for btc testnet4

### Refactor

Expand Down
1 change: 1 addition & 0 deletions docs/openapi/openapi.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56987,6 +56987,7 @@ definitions:
- solana_devnet
- solana_localnet
- btc_signet_testnet
- btc_testnet4
ws4charlie marked this conversation as resolved.
Show resolved Hide resolved
default: empty
title: |-
ChainName represents the name of the chain
Expand Down
15 changes: 15 additions & 0 deletions pkg/chains/chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ var (
Name: "btc_testnet",
}

// BitcoinSignetTestnet is Bitcoin Signet testnet
BitcoinSignetTestnet = Chain{
ChainName: ChainName_btc_signet_testnet,
ChainId: 18333,
Expand All @@ -181,6 +182,19 @@ var (
Name: "btc_signet_testnet",
}

// BitcoinTestnet4 is Bitcoin testnet4
BitcoinTestnet4 = Chain{
ChainName: ChainName_btc_testnet4,
ChainId: 18334,
Network: Network_btc,
NetworkType: NetworkType_testnet,
Vm: Vm_no_vm,
Consensus: Consensus_bitcoin,
IsExternal: true,
CctxGateway: CCTXGateway_observers,
Name: "btc_testnet4",
}

// Amoy is Polygon amoy testnet
Amoy = Chain{
ChainName: ChainName_amoy_testnet,
Expand Down Expand Up @@ -360,6 +374,7 @@ func DefaultChainsList() []Chain {
Ethereum,
BitcoinTestnet,
BitcoinSignetTestnet,
BitcoinTestnet4,
Mumbai,
Amoy,
BscTestnet,
Expand Down
104 changes: 54 additions & 50 deletions pkg/chains/chains.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/chains/chains_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func TestChainListByNetworkType(t *testing.T) {
chains.ZetaChainTestnet,
chains.BitcoinTestnet,
chains.BitcoinSignetTestnet,
chains.BitcoinTestnet4,
chains.Mumbai,
chains.Amoy,
chains.BscTestnet,
Expand Down Expand Up @@ -95,6 +96,7 @@ func TestChainListByNetwork(t *testing.T) {
chains.BitcoinMainnet,
chains.BitcoinTestnet,
chains.BitcoinSignetTestnet,
chains.BitcoinTestnet4,
chains.BitcoinRegtest,
},
},
Expand Down Expand Up @@ -144,6 +146,7 @@ func TestDefaultChainList(t *testing.T) {
chains.Ethereum,
chains.BitcoinTestnet,
chains.BitcoinSignetTestnet,
chains.BitcoinTestnet4,
chains.Mumbai,
chains.Amoy,
chains.BscTestnet,
Expand Down Expand Up @@ -181,6 +184,7 @@ func TestChainListByGateway(t *testing.T) {
chains.Ethereum,
chains.BitcoinTestnet,
chains.BitcoinSignetTestnet,
chains.BitcoinTestnet4,
chains.Mumbai,
chains.Amoy,
chains.BscTestnet,
Expand Down Expand Up @@ -224,6 +228,7 @@ func TestExternalChainList(t *testing.T) {
chains.Ethereum,
chains.BitcoinTestnet,
chains.BitcoinSignetTestnet,
chains.BitcoinTestnet4,
chains.Mumbai,
chains.Amoy,
chains.BscTestnet,
Expand Down
1 change: 1 addition & 0 deletions proto/zetachain/zetacore/pkg/chains/chains.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ enum ChainName {
solana_localnet = 23;

btc_signet_testnet = 24;
ws4charlie marked this conversation as resolved.
Show resolved Hide resolved
btc_testnet4 = 25;
ws4charlie marked this conversation as resolved.
Show resolved Hide resolved
}

// Network represents the network of the chain
Expand Down
5 changes: 5 additions & 0 deletions typescript/zetachain/zetacore/pkg/chains/chains_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ export declare enum ChainName {
* @generated from enum value: btc_signet_testnet = 24;
*/
btc_signet_testnet = 24,

/**
* @generated from enum value: btc_testnet4 = 25;
*/
btc_testnet4 = 25,
}

/**
Expand Down
2 changes: 1 addition & 1 deletion zetaclient/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type BTCConfig struct {
RPCUsername string `mask:"filled"`
RPCPassword string `mask:"filled"`
RPCHost string `mask:"filled"`
RPCParams string // "regtest", "mainnet", "testnet3" , "signet"
RPCParams string // "regtest", "mainnet", "testnet3" , "signet", "testnet4"
RPCAlertLatency int64
}

Expand Down
Loading