From 60b96ea55ff5825a9a87ce392b2c71ae9ad00846 Mon Sep 17 00:00:00 2001 From: Matthieu Vachon Date: Tue, 3 Aug 2021 09:23:49 -0400 Subject: [PATCH] Bumped eos-go and fixed few errors in `booter` directory --- booter/migrator/exporter.go | 12 ++++++------ go.mod | 2 +- go.sum | 3 +++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/booter/migrator/exporter.go b/booter/migrator/exporter.go index b3669f8c..b78060e7 100644 --- a/booter/migrator/exporter.go +++ b/booter/migrator/exporter.go @@ -80,8 +80,8 @@ func (e *exporter) Export() error { e.logger.Debug("new section", zap.String("section_name", string(currentSection.Name)), zap.Uint64("row_count", currentSection.RowCount), - zap.Uint64("bytes_count", currentSection.BufferSize), - zap.Uint64("bytes_count", currentSection.Offset), + zap.Uint64("buffer_size", currentSection.BufferSize), + zap.Uint64("offset", currentSection.Offset), ) } @@ -106,7 +106,7 @@ func (e *exporter) Export() error { err = reader.ProcessCurrentSection(e.processContractTable) } - if err == eossnapshot.SectionHandlerNotFound { + if err == eossnapshot.ErrSectionHandlerNotFound { e.logger.Warn("section handler not found", zap.String("section_name", string(currentSection.Name)), ) @@ -130,7 +130,7 @@ func (e *exporter) Export() error { for accountName, account := range e.accounts { err = e.exportAccount(accountName, account) if err != nil { - fmt.Errorf("failed to export account %q: %w", string(accountName), err) + return fmt.Errorf("failed to export account %q: %w", string(accountName), err) } } @@ -138,7 +138,7 @@ func (e *exporter) Export() error { for key, tblScope := range e.tableScopes { err = e.exportTableScope(tblScope) if err != nil { - fmt.Errorf("failed to export table-scope %s : %w", key, err) + return fmt.Errorf("failed to export table-scope %s : %w", key, err) } } return nil @@ -429,7 +429,7 @@ func (e *exporter) processTableID(obj *eossnapshot.TableIDObject) error { func (e *exporter) processContractRow(obj *eossnapshot.KeyValueObject) error { account, found := e.accounts[AN(e.currentTable.Code)] if !found { - fmt.Errorf("unable to process contract row: unknown account %q", AN(e.currentTable.Code)) + return fmt.Errorf("unable to process contract row: unknown account %q", AN(e.currentTable.Code)) } tableScopeKey := tableScopeKey(e.currentTable.Code, e.currentTable.TableName, e.currentTable.Scope) diff --git a/go.mod b/go.mod index bdec24c2..aca23380 100644 --- a/go.mod +++ b/go.mod @@ -51,7 +51,7 @@ require ( github.com/dfuse-io/shutter v1.4.1 github.com/dfuse-io/validator v0.0.0-20200407012817-82c55c634c7a github.com/dustin/go-humanize v1.0.0 - github.com/eoscanada/eos-go v0.9.1-0.20210222170049-21697b8969f6 + github.com/eoscanada/eos-go v0.9.1-0.20210802215146-d4a45e07e9b5 github.com/eoscanada/eosc v1.4.0 github.com/eoscanada/pitreos v1.1.1-0.20200721154110-fb345999fa39 github.com/francoispqt/gojay v1.2.13 diff --git a/go.sum b/go.sum index 6492eafa..37e95dfc 100644 --- a/go.sum +++ b/go.sum @@ -474,6 +474,8 @@ github.com/eoscanada/eos-go v0.9.1-0.20200506160036-5e090ae689ef/go.mod h1:exxz2 github.com/eoscanada/eos-go v0.9.1-0.20200723180508-f68c7571db82/go.mod h1:exxz2Fyjqx23FIYF1QlhhhggYZxcbZMGp2H/4h7I34Y= github.com/eoscanada/eos-go v0.9.1-0.20210222170049-21697b8969f6 h1:ZcY0wchKkZo6eTE9SEp1EKvniE7qY02OuNSUtRG2t64= github.com/eoscanada/eos-go v0.9.1-0.20210222170049-21697b8969f6/go.mod h1:6rqBwgLY59dZN1xqoA8SoHDal0gpNvh1L1Qa3ib8QsY= +github.com/eoscanada/eos-go v0.9.1-0.20210802215146-d4a45e07e9b5 h1:adxk5zxtAbdaCFtlSfSfBiE6tvRR/57W8AAH/XwFTac= +github.com/eoscanada/eos-go v0.9.1-0.20210802215146-d4a45e07e9b5/go.mod h1:j+tTXkGNu094KcquTwf5i6KBq4M0G9xugwf/8EZKYxQ= github.com/eoscanada/eosc v1.4.0 h1:wqlRNjrKFwX9Y30sgJfgdNxLol2WuEstYP30wr6jyoc= github.com/eoscanada/eosc v1.4.0/go.mod h1:0I+yYzRUTbIMgQsBjBYyNdE5idtbUMMkUQM4fN5A3P4= github.com/eoscanada/pitreos v1.1.1-0.20200721154110-fb345999fa39 h1:JQ7Gc43VO/HJb/mNc9otItimhUi5nGKH7ZvINbidcyg= @@ -1044,6 +1046,7 @@ github.com/tidwall/gjson v1.2.1/go.mod h1:c/nTNbUr0E0OrXEhq1pwa8iEgc2DOt4ZZqAt1H github.com/tidwall/gjson v1.3.2/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls= github.com/tidwall/gjson v1.5.0 h1:QCssIUI7J0RStkzIcI4A7O6P8rDA5wi5IPf70uqKSxg= github.com/tidwall/gjson v1.5.0/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls= +github.com/tidwall/gjson v1.6.5/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= github.com/tidwall/gjson v1.6.7 h1:Mb1M9HZCRWEcXQ8ieJo7auYyyiSux6w9XN3AdTpxJrE= github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc=