diff --git a/executor/bbc_executor.go b/executor/bbc_executor.go index 0f89806..1319ec8 100644 --- a/executor/bbc_executor.go +++ b/executor/bbc_executor.go @@ -68,14 +68,16 @@ func initBBCClients(keyManager keys.KeyManager, providers []string, network ctyp } func NewBBCExecutor(cfg *config.Config, networkType ctypes.ChainNetwork) (*BBCExecutor, error) { - mnemonic, err := getMnemonic(&cfg.BBCConfig) - if err != nil { - panic(err.Error()) - } - - keyManager, err := keys.NewMnemonicKeyManager(mnemonic) - if err != nil { - panic(err.Error()) + var keyManager keys.KeyManager + if len(cfg.BSCConfig.MonitorDataSeedList) >= 2 { + mnemonic, err := getMnemonic(&cfg.BBCConfig) + if err != nil { + panic(err.Error()) + } + keyManager, err = keys.NewMnemonicKeyManager(mnemonic) + if err != nil { + panic(err.Error()) + } } return &BBCExecutor{ diff --git a/executor/bsc_executor_test.go b/executor/bsc_executor_test.go index 61fa6a2..9fb0347 100644 --- a/executor/bsc_executor_test.go +++ b/executor/bsc_executor_test.go @@ -28,11 +28,11 @@ var ( DestChainID: 97, }, BBCConfig: config.BBCConfig{ - RpcAddrs: BBCRpc, + RpcAddrs: []string{BBCRpc}, }, BSCConfig: config.BSCConfig{ GasLimit: 4700000, - Providers: provider, + Providers: []string{provider}, PrivateKey: privateKey, KeyType: config.KeyTypeLocalPrivateKey, }, @@ -202,7 +202,7 @@ func TestBSCExecutor_CheckRelayer(t *testing.T) { callOpts, err := executor.getCallOpts() require.NoError(t, err) - instance, err := relayerhub.NewRelayerhub(relayerHubContractAddr, executor.bscClients) + instance, err := relayerhub.NewRelayerhub(relayerHubContractAddr, executor.GetClient()) require.NoError(t, err) isRelayer, err := instance.IsRelayer(callOpts, executor.txSender)