@@ -10,6 +10,8 @@ import (
10
10
11
11
"github.com/ethereum/go-ethereum/ethclient"
12
12
"github.com/onrik/ethrpc"
13
+ "github.com/zeta-chain/zetacore/pkg/chains"
14
+ "github.com/zeta-chain/zetacore/pkg/coin"
13
15
"github.com/zeta-chain/zetacore/zetaclient/bitcoin"
14
16
corecontext "github.com/zeta-chain/zetacore/zetaclient/core_context"
15
17
"github.com/zeta-chain/zetacore/zetaclient/evm"
@@ -22,7 +24,6 @@ import (
22
24
ethcommon "github.com/ethereum/go-ethereum/common"
23
25
"github.com/rs/zerolog"
24
26
"github.com/spf13/cobra"
25
- "github.com/zeta-chain/zetacore/common"
26
27
"github.com/zeta-chain/zetacore/testutil/sample"
27
28
observertypes "github.com/zeta-chain/zetacore/x/observer/types"
28
29
"github.com/zeta-chain/zetacore/zetaclient/config"
@@ -90,12 +91,12 @@ func DebugCmd() *cobra.Command {
90
91
return err
91
92
}
92
93
93
- chain := common .GetChainFromChainID (chainID )
94
+ chain := chains .GetChainFromChainID (chainID )
94
95
if chain == nil {
95
96
return fmt .Errorf ("invalid chain id" )
96
97
}
97
98
98
- if common .IsEVMChain (chain .ChainId ) {
99
+ if chains .IsEVMChain (chain .ChainId ) {
99
100
100
101
ob := evm.ChainClient {
101
102
Mu : & sync.Mutex {},
@@ -104,7 +105,7 @@ func DebugCmd() *cobra.Command {
104
105
ob .WithLogger (chainLogger )
105
106
var ethRPC * ethrpc.EthRPC
106
107
var client * ethclient.Client
107
- coinType := common .CoinType_Cmd
108
+ coinType := coin .CoinType_Cmd
108
109
for chain , evmConfig := range cfg .GetAllEVMConfigs () {
109
110
if chainID == chain {
110
111
ethRPC = ethrpc .NewEthRPC (evmConfig .Endpoint )
@@ -114,7 +115,7 @@ func DebugCmd() *cobra.Command {
114
115
}
115
116
ob .WithEvmClient (client )
116
117
ob .WithEvmJSONRPC (ethRPC )
117
- ob .WithChain (* common .GetChainFromChainID (chainID ))
118
+ ob .WithChain (* chains .GetChainFromChainID (chainID ))
118
119
}
119
120
}
120
121
hash := ethcommon .HexToHash (txHash )
@@ -144,29 +145,29 @@ func DebugCmd() *cobra.Command {
144
145
}
145
146
evmChainParams .ZetaTokenContractAddress = chainParams .ZetaTokenContractAddress
146
147
if strings .EqualFold (tx .To , chainParams .ConnectorContractAddress ) {
147
- coinType = common .CoinType_Zeta
148
+ coinType = coin .CoinType_Zeta
148
149
} else if strings .EqualFold (tx .To , chainParams .Erc20CustodyContractAddress ) {
149
- coinType = common .CoinType_ERC20
150
+ coinType = coin .CoinType_ERC20
150
151
} else if strings .EqualFold (tx .To , tssEthAddress ) {
151
- coinType = common .CoinType_Gas
152
+ coinType = coin .CoinType_Gas
152
153
}
153
154
}
154
155
}
155
156
156
157
switch coinType {
157
- case common .CoinType_Zeta :
158
+ case coin .CoinType_Zeta :
158
159
ballotIdentifier , err = ob .CheckAndVoteInboundTokenZeta (tx , receipt , false )
159
160
if err != nil {
160
161
return err
161
162
}
162
163
163
- case common .CoinType_ERC20 :
164
+ case coin .CoinType_ERC20 :
164
165
ballotIdentifier , err = ob .CheckAndVoteInboundTokenERC20 (tx , receipt , false )
165
166
if err != nil {
166
167
return err
167
168
}
168
169
169
- case common .CoinType_Gas :
170
+ case coin .CoinType_Gas :
170
171
ballotIdentifier , err = ob .CheckAndVoteInboundTokenGas (tx , receipt , false )
171
172
if err != nil {
172
173
return err
@@ -175,13 +176,13 @@ func DebugCmd() *cobra.Command {
175
176
fmt .Println ("CoinType not detected" )
176
177
}
177
178
fmt .Println ("CoinType : " , coinType )
178
- } else if common .IsBitcoinChain (chain .ChainId ) {
179
+ } else if chains .IsBitcoinChain (chain .ChainId ) {
179
180
obBtc := bitcoin.BTCChainClient {
180
181
Mu : & sync.Mutex {},
181
182
}
182
183
obBtc .WithZetaClient (bridge )
183
184
obBtc .WithLogger (chainLogger )
184
- obBtc .WithChain (* common .GetChainFromChainID (chainID ))
185
+ obBtc .WithChain (* chains .GetChainFromChainID (chainID ))
185
186
connCfg := & rpcclient.ConnConfig {
186
187
Host : cfg .BitcoinConfig .RPCHost ,
187
188
User : cfg .BitcoinConfig .RPCUsername ,
0 commit comments