diff --git a/chainregistry/requests.go b/chainregistry/requests.go index c86413ce..af44125e 100644 --- a/chainregistry/requests.go +++ b/chainregistry/requests.go @@ -86,7 +86,6 @@ func GetAssetMapOnDisk(chainRegistryLocation string, chainRegBlacklist map[strin currAssets := &AssetList{} err = json.NewDecoder(jsonFile).Decode(currAssets) - if err != nil { return nil, err } diff --git a/client/client.go b/client/client.go index a80efbaa..145f8340 100644 --- a/client/client.go +++ b/client/client.go @@ -102,7 +102,6 @@ func setup() (*gorm.DB, *config.ClientConfig, int, string, error) { dbTypes.CacheIBCDenoms(db) err = db.AutoMigrate(&dbTypes.Address{}, &AddressUsageCSV{}, &AddressUsageJSON{}) - if err != nil { config.Log.Fatalf("Error migrating client models. Err: %v", err) } diff --git a/cmd/block_enqueue.go b/cmd/block_enqueue.go index b4f86d90..e4e31757 100644 --- a/cmd/block_enqueue.go +++ b/cmd/block_enqueue.go @@ -75,7 +75,6 @@ func (idxr *Indexer) enqueueBlocksToProcessFromBlockInputFile(blockChan chan int } var blocksToIndex []uint64 err = json.Unmarshal(plan, &blocksToIndex) - if err != nil { errString := err.Error() diff --git a/cmd/index.go b/cmd/index.go index 965abd73..d82403b3 100644 --- a/cmd/index.go +++ b/cmd/index.go @@ -732,7 +732,6 @@ func (idxr *Indexer) doDBUpdates(wg *sync.WaitGroup, txDataChan chan *dbData, bl } err = dbTypes.UpdateEpochIndexingStatus(idxr.db, idxr.dryRun, epochEventData.epochNumber, epochEventData.epochIdentifier, idxr.cfg.Lens.ChainID, idxr.cfg.Lens.ChainName) - if err != nil { config.Log.Fatal(fmt.Sprintf("Error indexing block events for %s. Could not mark Epoch indexed.", identifierLoggingString), err) } diff --git a/config/index_config.go b/config/index_config.go index 44db2b36..ef2f5605 100644 --- a/config/index_config.go +++ b/config/index_config.go @@ -83,7 +83,6 @@ func (conf *IndexConfig) Validate() error { lensConf := conf.Lens lensConf, err = validateLensConf(lensConf) - if err != nil { return err } @@ -91,7 +90,6 @@ func (conf *IndexConfig) Validate() error { conf.Lens = lensConf err = validateThrottlingConf(conf.Base.throttlingBase) - if err != nil { return err } diff --git a/config/update_denoms_config.go b/config/update_denoms_config.go index e1da628c..b6ac041a 100644 --- a/config/update_denoms_config.go +++ b/config/update_denoms_config.go @@ -29,7 +29,6 @@ func (conf *UpdateDenomsConfig) Validate() error { lensConf := conf.Lens lensConf, err = validateLensConf(lensConf) - if err != nil { return err } diff --git a/config/update_epochs_config.go b/config/update_epochs_config.go index ce50af7d..85775ad4 100644 --- a/config/update_epochs_config.go +++ b/config/update_epochs_config.go @@ -31,7 +31,6 @@ func (conf *UpdateEpochsConfig) Validate() error { lensConf := conf.Lens lensConf, err = validateLensConf(lensConf) - if err != nil { return err } @@ -39,7 +38,6 @@ func (conf *UpdateEpochsConfig) Validate() error { conf.Lens = lensConf err = validateThrottlingConf(conf.Base.throttlingBase) - if err != nil { return err } diff --git a/core/tx.go b/core/tx.go index c04337b3..a00f950b 100644 --- a/core/tx.go +++ b/core/tx.go @@ -283,7 +283,6 @@ func ProcessRPCBlockByHeightTXs(db *gorm.DB, cl *client.ChainClient, blockResult // We can entirely ignore failed TXs in downstream parsers, because according to the Cosmos specification, a single failed message in a TX fails the whole TX if txResult.Code == 0 { logs, err = types.ParseABCILogs(txResult.Log) - if err != nil { logs, err = indexerEvents.ParseTxEventsToMessageIndexEvents(len(txFull.Body.Messages), txResult.Events) } diff --git a/csv/parsers/accointing/accointing.go b/csv/parsers/accointing/accointing.go index 103c0733..95c9cf29 100644 --- a/csv/parsers/accointing/accointing.go +++ b/csv/parsers/accointing/accointing.go @@ -158,12 +158,12 @@ func HandleFees(address string, events []db.TaxableTransaction, allFees []db.Fee // We need to gather all unique fees, but we are receiving Messages not Txes // Make a map from TX hash to fees array to keep unique txToFeesMap := make(map[uint][]db.Fee) - txIdsToTx := make(map[uint]db.Tx) + txIDsToTX := make(map[uint]db.Tx) for _, event := range events { txID := event.Message.Tx.ID feeStore := event.Message.Tx.Fees txToFeesMap[txID] = feeStore - txIdsToTx[txID] = event.Message.Tx + txIDsToTX[txID] = event.Message.Tx } // Due to the way we are parsing, we may have fees for TX that we don't have events for @@ -171,7 +171,7 @@ func HandleFees(address string, events []db.TaxableTransaction, allFees []db.Fee txID := fee.Tx.ID if _, ok := txToFeesMap[txID]; !ok { txToFeesMap[txID] = []db.Fee{fee} - txIdsToTx[txID] = fee.Tx + txIDsToTX[txID] = fee.Tx } } @@ -179,7 +179,7 @@ func HandleFees(address string, events []db.TaxableTransaction, allFees []db.Fee for _, fee := range txFees { if fee.PayerAddress.Address == address { newRow := Row{} - err = newRow.ParseFee(txIdsToTx[id], fee) + err = newRow.ParseFee(txIDsToTX[id], fee) if err != nil { return nil, err } diff --git a/csv/parsers/koinly/koinly.go b/csv/parsers/koinly/koinly.go index 3b460b3d..501e9c02 100644 --- a/csv/parsers/koinly/koinly.go +++ b/csv/parsers/koinly/koinly.go @@ -29,7 +29,7 @@ var unsupportedCoins = []string{ var coinReplacementMap = map[string]string{} -var symbolsToKoinlyIds = map[string]string{} +var symbolsToKoinlyIDs = map[string]string{} // Probably not the best place for this, but its only used in Koinly for now // May want to consider adding the asset list URL as a config value and passing the AssetList value down to parsers if needed @@ -42,7 +42,7 @@ func init() { for _, asset := range assetList.Assets { // Required format for koinly IDs is ID: - symbolsToKoinlyIds[asset.Symbol] = fmt.Sprintf("ID:%s", asset.KoinlyID) + symbolsToKoinlyIDs[asset.Symbol] = fmt.Sprintf("ID:%s", asset.KoinlyID) } } @@ -124,18 +124,18 @@ func (p *Parser) GetRows(address string, startDate, endDate *time.Time) ([]parse for i, row := range koinlyRows { if row.FeeCurrency != "" { - if _, ok := symbolsToKoinlyIds[row.FeeCurrency]; ok { - koinlyRows[i].FeeCurrency = symbolsToKoinlyIds[row.FeeCurrency] + if _, ok := symbolsToKoinlyIDs[row.FeeCurrency]; ok { + koinlyRows[i].FeeCurrency = symbolsToKoinlyIDs[row.FeeCurrency] } } if row.ReceivedCurrency != "" { - if _, ok := symbolsToKoinlyIds[row.ReceivedCurrency]; ok { - koinlyRows[i].ReceivedCurrency = symbolsToKoinlyIds[row.ReceivedCurrency] + if _, ok := symbolsToKoinlyIDs[row.ReceivedCurrency]; ok { + koinlyRows[i].ReceivedCurrency = symbolsToKoinlyIDs[row.ReceivedCurrency] } } if row.SentCurrency != "" { - if _, ok := symbolsToKoinlyIds[row.SentCurrency]; ok { - koinlyRows[i].SentCurrency = symbolsToKoinlyIds[row.SentCurrency] + if _, ok := symbolsToKoinlyIDs[row.SentCurrency]; ok { + koinlyRows[i].SentCurrency = symbolsToKoinlyIDs[row.SentCurrency] } } } @@ -226,12 +226,12 @@ func HandleFees(address string, events []db.TaxableTransaction, allFees []db.Fee // We need to gather all unique fees, but we are receiving Messages not Txes // Make a map from TX hash to fees array to keep unique txToFeesMap := make(map[uint][]db.Fee) - txIdsToTx := make(map[uint]db.Tx) + txIDsToTX := make(map[uint]db.Tx) for _, event := range events { txID := event.Message.Tx.ID feeStore := event.Message.Tx.Fees txToFeesMap[txID] = feeStore - txIdsToTx[txID] = event.Message.Tx + txIDsToTX[txID] = event.Message.Tx } // Due to the way we are parsing, we may have fees for TX that we don't have events for @@ -239,7 +239,7 @@ func HandleFees(address string, events []db.TaxableTransaction, allFees []db.Fee txID := fee.Tx.ID if _, ok := txToFeesMap[txID]; !ok { txToFeesMap[txID] = []db.Fee{fee} - txIdsToTx[txID] = fee.Tx + txIDsToTX[txID] = fee.Tx } } @@ -247,7 +247,7 @@ func HandleFees(address string, events []db.TaxableTransaction, allFees []db.Fee for _, fee := range txFees { if fee.PayerAddress.Address == address { newRow := Row{} - err = newRow.ParseFee(txIdsToTx[id], fee) + err = newRow.ParseFee(txIDsToTX[id], fee) if err != nil { return nil, err } diff --git a/csv/parsers/taxbit/taxbit.go b/csv/parsers/taxbit/taxbit.go index e3ef1bb7..3afb3e5f 100644 --- a/csv/parsers/taxbit/taxbit.go +++ b/csv/parsers/taxbit/taxbit.go @@ -155,12 +155,12 @@ func HandleFees(address string, events []db.TaxableTransaction, allFees []db.Fee // We need to gather all unique fees, but we are receiving Messages not Txes // Make a map from TX hash to fees array to keep unique txToFeesMap := make(map[uint][]db.Fee) - txIdsToTx := make(map[uint]db.Tx) + txIDsToTX := make(map[uint]db.Tx) for _, event := range events { txID := event.Message.Tx.ID feeStore := event.Message.Tx.Fees txToFeesMap[txID] = feeStore - txIdsToTx[txID] = event.Message.Tx + txIDsToTX[txID] = event.Message.Tx } // Due to the way we are parsing, we may have fees for TX that we don't have events for @@ -168,7 +168,7 @@ func HandleFees(address string, events []db.TaxableTransaction, allFees []db.Fee txID := fee.Tx.ID if _, ok := txToFeesMap[txID]; !ok { txToFeesMap[txID] = []db.Fee{fee} - txIdsToTx[txID] = fee.Tx + txIDsToTX[txID] = fee.Tx } } @@ -176,7 +176,7 @@ func HandleFees(address string, events []db.TaxableTransaction, allFees []db.Fee for _, fee := range txFees { if fee.PayerAddress.Address == address { newRow := Row{} - err = newRow.ParseFee(txIdsToTx[id], fee) + err = newRow.ParseFee(txIDsToTX[id], fee) if err != nil { return nil, err } diff --git a/osmosis/modules/gamm/exits.go b/osmosis/modules/gamm/exits.go index 1fc768b3..39c76bea 100644 --- a/osmosis/modules/gamm/exits.go +++ b/osmosis/modules/gamm/exits.go @@ -195,7 +195,6 @@ func (sf *WrapperMsgExitSwapShareAmountIn) HandleMsg(msgType string, msg sdk.Msg return &txModule.MessageLogFormatError{MessageType: msgType, Log: fmt.Sprintf("%+v", log)} } sf.TokenOut, err = sdk.ParseCoinNormalized(tokenOut) - if err != nil { return &txModule.MessageLogFormatError{MessageType: msgType, Log: fmt.Sprintf("%+v", log)} } @@ -357,7 +356,6 @@ func (sf *WrapperMsgExitSwapExternAmountOut) HandleMsg(msgType string, msg sdk.M return &txModule.MessageLogFormatError{MessageType: msgType, Log: fmt.Sprintf("%+v", log)} } sf.TokenOut, err = sdk.ParseCoinNormalized(tokenOut) - if err != nil { return &txModule.MessageLogFormatError{MessageType: msgType, Log: fmt.Sprintf("%+v", log)} } diff --git a/rest/requests.go b/rest/requests.go index 6459434e..6c9bfb84 100644 --- a/rest/requests.go +++ b/rest/requests.go @@ -65,7 +65,6 @@ func GetTxsByBlockHeight(host string, height uint64) (tx.GetTxByBlockHeightRespo defer resp.Body.Close() err = checkResponseErrorCode(requestEndpoint, resp) - if err != nil { return result, err } @@ -76,7 +75,6 @@ func GetTxsByBlockHeight(host string, height uint64) (tx.GetTxByBlockHeightRespo } err = json.Unmarshal(body, &result) - if err != nil { return result, err } @@ -97,7 +95,6 @@ func GetLatestBlock(host string) (tx.GetLatestBlockResponse, error) { defer resp.Body.Close() err = checkResponseErrorCode(requestEndpoint, resp) - if err != nil { return result, err } @@ -108,7 +105,6 @@ func GetLatestBlock(host string) (tx.GetLatestBlockResponse, error) { } err = json.Unmarshal(body, &result) - if err != nil { return result, err } diff --git a/rpc/requests.go b/rpc/requests.go index 7311207c..799d6073 100644 --- a/rpc/requests.go +++ b/rpc/requests.go @@ -56,7 +56,6 @@ func GetTxsByBlockHeight(cl *lensClient.ChainClient, height int64) (resp *txType options := lensQuery.QueryOptions{Height: height, Pagination: &pg} query := lensQuery.Query{Client: cl, Options: &options} resp, unpackError, err := query.TxByHeight(cl.Codec) - if err != nil { return nil, unpackError, err }