From 6adf45bb9499e5b96a03ae345fea9f345271e357 Mon Sep 17 00:00:00 2001 From: lumtis Date: Fri, 28 Jun 2024 10:46:04 +0200 Subject: [PATCH] add TODO --- pkg/chains/chains.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/chains/chains.go b/pkg/chains/chains.go index 3e0095e61c..764eb56bbe 100644 --- a/pkg/chains/chains.go +++ b/pkg/chains/chains.go @@ -390,9 +390,11 @@ func CombineDefaultChainsList(chains []Chain) []*Chain { // CombineChainList combines a list of chains with a list of chains // duplicated chain ID are overwritten by the second list -func CombineChainList(base []Chain, additional ...Chain) []Chain { - combined := make([]*Chain, 0, len(base) + len(additional)) - combined = append(combined, chains1...) +// TODO: remove pointers +// https://github.com/zeta-chain/node/issues/2080 +func CombineChainList(base []*Chain, additional []*Chain) []*Chain { + combined := make([]*Chain, 0, len(base)+len(additional)) + combined = append(combined, additional...) // map chain ID in chains1 to index in the list chainIDIndexMap := make(map[int64]int) @@ -402,7 +404,7 @@ func CombineChainList(base []Chain, additional ...Chain) []Chain { // add chains2 to combined // if chain ID already exists in chains1, overwrite it - for _, chain := range chains2 { + for _, chain := range additional { if index, ok := chainIDIndexMap[chain.ChainId]; ok { combined[index] = chain } else {