From b52654f8856fd9ce599599a003d3c3cf3290d2de Mon Sep 17 00:00:00 2001 From: Charlie Chen Date: Wed, 3 Jul 2024 16:37:01 -0500 Subject: [PATCH] give more accurate names to methods --- zetaclient/orchestrator/chain_activate.go | 12 ++++++------ zetaclient/orchestrator/chain_activate_test.go | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/zetaclient/orchestrator/chain_activate.go b/zetaclient/orchestrator/chain_activate.go index 613fd3ade4..50426b0565 100644 --- a/zetaclient/orchestrator/chain_activate.go +++ b/zetaclient/orchestrator/chain_activate.go @@ -52,8 +52,8 @@ func (oc *Orchestrator) ActivateAndDeactivateChains() { newObserverMap := make(map[int64]interfaces.ChainObserver) // create new signers and observers - oc.CreateObserversEVM(newSignerMap, newObserverMap) - oc.CreateObserversBTC(newSignerMap, newObserverMap) + oc.CreateSignerObserverEVM(newSignerMap, newObserverMap) + oc.CreateSignerObserverBTC(newSignerMap, newObserverMap) // activate newly supported chains and deactivate chains that are no longer supported oc.DeactivateChains(newObserverMap) @@ -113,8 +113,8 @@ func (oc *Orchestrator) ActivateChains( } } -// CreateObserversEVM creates signer and observer maps for all enabled EVM chains -func (oc *Orchestrator) CreateObserversEVM( +// CreateSignerObserverEVM creates signer and observer maps for all enabled EVM chains +func (oc *Orchestrator) CreateSignerObserverEVM( resultSignerMap map[int64]interfaces.ChainSigner, resultObserverMap map[int64]interfaces.ChainObserver, ) { @@ -181,8 +181,8 @@ func (oc *Orchestrator) CreateObserversEVM( } } -// CreateObserversBTC creates signer and observer maps for all enabled BTC chains -func (oc *Orchestrator) CreateObserversBTC( +// CreateSignerObserverBTC creates signer and observer maps for all enabled BTC chains +func (oc *Orchestrator) CreateSignerObserverBTC( resultSignerMap map[int64]interfaces.ChainSigner, resultObserverMap map[int64]interfaces.ChainObserver, ) { diff --git a/zetaclient/orchestrator/chain_activate_test.go b/zetaclient/orchestrator/chain_activate_test.go index aa826bc9f7..7df06647f5 100644 --- a/zetaclient/orchestrator/chain_activate_test.go +++ b/zetaclient/orchestrator/chain_activate_test.go @@ -122,7 +122,7 @@ func Test_ActivateChains(t *testing.T) { // create new signer and observer maps newSignerMap := make(map[int64]interfaces.ChainSigner) newObserverMap := make(map[int64]interfaces.ChainObserver) - oc.CreateObserversEVM(newSignerMap, newObserverMap) + oc.CreateSignerObserverEVM(newSignerMap, newObserverMap) // activate chains oc.ActivateChains(newSignerMap, newObserverMap) @@ -187,7 +187,7 @@ func Test_DeactivateChains(t *testing.T) { // create new signer and observer maps newSignerMap := make(map[int64]interfaces.ChainSigner) newObserverMap := make(map[int64]interfaces.ChainObserver) - oc.CreateObserversEVM(newSignerMap, newObserverMap) + oc.CreateSignerObserverEVM(newSignerMap, newObserverMap) // activate chains oc.ActivateChains(newSignerMap, newObserverMap) @@ -205,7 +205,7 @@ func Test_DeactivateChains(t *testing.T) { // create maps again based on newly updated config newSignerMap = make(map[int64]interfaces.ChainSigner) newObserverMap = make(map[int64]interfaces.ChainObserver) - oc.CreateObserversEVM(newSignerMap, newObserverMap) + oc.CreateSignerObserverEVM(newSignerMap, newObserverMap) // deactivate chains oc.DeactivateChains(newObserverMap) @@ -221,7 +221,7 @@ func Test_DeactivateChains(t *testing.T) { } } -func Test_CreateObserversEVM(t *testing.T) { +func Test_CreateSignerObserverEVM(t *testing.T) { // define test chains and chain params evmChain := chains.Ethereum btcChain := chains.BitcoinMainnet @@ -292,7 +292,7 @@ func Test_CreateObserversEVM(t *testing.T) { // create observers signerMap := make(map[int64]interfaces.ChainSigner) observerMap := make(map[int64]interfaces.ChainObserver) - oc.CreateObserversEVM(signerMap, observerMap) + oc.CreateSignerObserverEVM(signerMap, observerMap) // assert signer/observer map require.Len(t, signerMap, tt.numObserverCreated) @@ -307,7 +307,7 @@ func Test_CreateObserversEVM(t *testing.T) { } } -func Test_CreateObserversBTC(t *testing.T) { +func Test_CreateSignerObserverBTC(t *testing.T) { // define test chains and chain params evmChain := chains.Ethereum btcChain := chains.BitcoinMainnet @@ -373,7 +373,7 @@ func Test_CreateObserversBTC(t *testing.T) { // create observers signerMap := make(map[int64]interfaces.ChainSigner) observerMap := make(map[int64]interfaces.ChainObserver) - oc.CreateObserversBTC(signerMap, observerMap) + oc.CreateSignerObserverBTC(signerMap, observerMap) // assert signer/observer map require.Len(t, signerMap, tt.numObserverCreated)