From 87f7b061a433c158ab7b12f54f6dbc21e1456e8e Mon Sep 17 00:00:00 2001 From: jingweicb <96205264+jingweicb@users.noreply.github.com> Date: Wed, 18 Jan 2023 11:08:18 -0800 Subject: [PATCH] bump up to 0.10.2 (#383) --- Dockerfile | 2 +- cmd/root.go | 2 +- pkg/processor/balance_storage_helper.go | 14 +++++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1545c72b..07d7bbdc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,7 @@ RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" WORKDIR /go/src -ARG VERSION=v0.10.1 +ARG VERSION=v0.10.2 RUN git clone https://github.com/coinbase/rosetta-cli.git && \ cd rosetta-cli && \ git fetch --all --tags && \ diff --git a/cmd/root.go b/cmd/root.go index 747239ac..3cca1e7b 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -488,6 +488,6 @@ var versionCmd = &cobra.Command{ Use: "version", Short: "Print rosetta-cli version", Run: func(cmd *cobra.Command, args []string) { - fmt.Println("v0.10.1") + fmt.Println("v0.10.2") }, } diff --git a/pkg/processor/balance_storage_helper.go b/pkg/processor/balance_storage_helper.go index f043691d..6f929b47 100644 --- a/pkg/processor/balance_storage_helper.go +++ b/pkg/processor/balance_storage_helper.go @@ -65,7 +65,13 @@ func NewBalanceStorageHelper( // Pre-process exemptAccounts on initialization // to provide fast lookup while syncing. for _, account := range exemptAccounts { - exemptMap[types.Hash(account)] = struct{}{} + // if users do not specify Currency, we add the address + // by this, all the Currencies in this address will be skipped + if account.Currency == nil { + exemptMap[account.Account.Address] = struct{}{} + } else { + exemptMap[types.Hash(account)] = struct{}{} + } } return &BalanceStorageHelper{ @@ -144,6 +150,12 @@ func (h *BalanceStorageHelper) ExemptFunc() parser.ExemptOperation { return true } } + // if exemptAccounts have the Account address means all the + // currencies in this Account address need to be skipped + _, existsAddress := h.exemptAccounts[op.Account.Address] + if existsAddress { + return existsAddress + } thisAcct := types.Hash(&types.AccountCurrency{ Account: op.Account,