Update rosetta-sdk-go
This commit is contained in:
parent
dc10fea5f6
commit
957c86c7f5
3 changed files with 12 additions and 10 deletions
2
go.mod
2
go.mod
|
@ -5,7 +5,7 @@ go 1.13
|
|||
require (
|
||||
github.com/btcsuite/btcd v0.21.0-beta
|
||||
github.com/btcsuite/btcutil v1.0.2
|
||||
github.com/coinbase/rosetta-sdk-go v0.5.7
|
||||
github.com/coinbase/rosetta-sdk-go v0.5.8-0.20201027202152-ec894b6612f8
|
||||
github.com/dgraph-io/badger/v2 v2.2007.2
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.2.2
|
||||
github.com/stretchr/testify v1.6.1
|
||||
|
|
4
go.sum
4
go.sum
|
@ -61,8 +61,8 @@ github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJ
|
|||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U=
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
github.com/coinbase/rosetta-sdk-go v0.5.7 h1:BaR/+O3GzrsyunVNkVQHtjDCcId8G1Fh/RqEbeyExnk=
|
||||
github.com/coinbase/rosetta-sdk-go v0.5.7/go.mod h1:l5aNeyeZKBkmWbVdkdLpWdToQ6hTwI7cZ1OU9cMbljY=
|
||||
github.com/coinbase/rosetta-sdk-go v0.5.8-0.20201027202152-ec894b6612f8 h1:oOe+VuEj7mZdiAAr/r2Lmbdkl2mQoUhce74y0jReFtI=
|
||||
github.com/coinbase/rosetta-sdk-go v0.5.8-0.20201027202152-ec894b6612f8/go.mod h1:l5aNeyeZKBkmWbVdkdLpWdToQ6hTwI7cZ1OU9cMbljY=
|
||||
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
|
||||
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
|
|
|
@ -783,23 +783,25 @@ func (i *Indexer) GetBalance(
|
|||
currency *types.Currency,
|
||||
blockIdentifier *types.PartialBlockIdentifier,
|
||||
) (*types.Amount, *types.BlockIdentifier, error) {
|
||||
// TODO: add block lazy transactional
|
||||
blockResponse, err := i.GetBlockLazy(ctx, blockIdentifier)
|
||||
dbTx := i.database.NewDatabaseTransaction(ctx, false)
|
||||
defer dbTx.Discard(ctx)
|
||||
|
||||
blockResponse, err := i.blockStorage.GetBlockLazyTransactional(
|
||||
ctx,
|
||||
blockIdentifier,
|
||||
dbTx,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
// TODO: when false if we query unknown, this could cause issue
|
||||
// TODO: add switch to not create unknown
|
||||
dbTx := i.database.NewDatabaseTransaction(ctx, false)
|
||||
defer dbTx.Discard(ctx)
|
||||
|
||||
amount, err := i.balanceStorage.GetBalanceTransactional(
|
||||
ctx,
|
||||
dbTx,
|
||||
accountIdentifier,
|
||||
currency,
|
||||
blockResponse.Block.BlockIdentifier,
|
||||
false,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
|
|
Loading…
Reference in a new issue