Skip to content

Commit

Permalink
Update inx-app
Browse files Browse the repository at this point in the history
  • Loading branch information
muXxer committed Nov 28, 2023
1 parent 86456d9 commit 2406726
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 136 deletions.
24 changes: 12 additions & 12 deletions components/restapi/core/utxo.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ func outputWithMetadataByID(c echo.Context) (*api.OutputWithMetadataResponse, er
func newOutputMetadataResponse(output *utxoledger.Output) (*api.OutputMetadata, error) {
latestCommitment := deps.Protocol.MainEngineInstance().SyncManager.LatestCommitment()

includedSlotIndex := output.SlotBooked()
includedSlot := output.SlotBooked()
includedCommitmentID := iotago.EmptyCommitmentID

if includedSlotIndex <= latestCommitment.Slot() &&
includedSlotIndex >= deps.Protocol.MainEngineInstance().CommittedAPI().ProtocolParameters().GenesisSlot() {
includedCommitment, err := deps.Protocol.MainEngineInstance().Storage.Commitments().Load(includedSlotIndex)
if includedSlot <= latestCommitment.Slot() &&
includedSlot >= deps.Protocol.MainEngineInstance().CommittedAPI().ProtocolParameters().GenesisSlot() {
includedCommitment, err := deps.Protocol.MainEngineInstance().Storage.Commitments().Load(includedSlot)
if err != nil {
return nil, ierrors.Wrapf(echo.ErrInternalServerError, "failed to load commitment with index %d: %s", includedSlotIndex, err)
return nil, ierrors.Wrapf(echo.ErrInternalServerError, "failed to load commitment with index %d: %s", includedSlot, err)
}
includedCommitmentID = includedCommitment.ID()
}
Expand All @@ -100,7 +100,7 @@ func newOutputMetadataResponse(output *utxoledger.Output) (*api.OutputMetadata,
OutputID: output.OutputID(),
BlockID: output.BlockID(),
Included: &api.OutputInclusionMetadata{
Slot: includedSlotIndex,
Slot: includedSlot,
TransactionID: output.OutputID().TransactionID(),
CommitmentID: includedCommitmentID,
},
Expand All @@ -114,20 +114,20 @@ func newSpentMetadataResponse(spent *utxoledger.Spent) (*api.OutputMetadata, err
return nil, err
}

spentSlotIndex := spent.SlotSpent()
spentSlot := spent.SlotSpent()
spentCommitmentID := iotago.EmptyCommitmentID

if spentSlotIndex <= newOutputMetadataResponse.LatestCommitmentID.Slot() &&
spentSlotIndex >= deps.Protocol.MainEngineInstance().CommittedAPI().ProtocolParameters().GenesisSlot() {
spentCommitment, err := deps.Protocol.MainEngineInstance().Storage.Commitments().Load(spentSlotIndex)
if spentSlot <= newOutputMetadataResponse.LatestCommitmentID.Slot() &&
spentSlot >= deps.Protocol.MainEngineInstance().CommittedAPI().ProtocolParameters().GenesisSlot() {
spentCommitment, err := deps.Protocol.MainEngineInstance().Storage.Commitments().Load(spentSlot)
if err != nil {
return nil, ierrors.Wrapf(echo.ErrInternalServerError, "failed to load commitment with index %d: %s", spentSlotIndex, err)
return nil, ierrors.Wrapf(echo.ErrInternalServerError, "failed to load commitment with index %d: %s", spentSlot, err)
}
spentCommitmentID = spentCommitment.ID()
}

newOutputMetadataResponse.Spent = &api.OutputConsumptionMetadata{
Slot: spentSlotIndex,
Slot: spentSlot,
TransactionID: spent.TransactionIDSpent(),
CommitmentID: spentCommitmentID,
}
Expand Down
28 changes: 14 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ require (
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/iotaledger/hive.go/ads v0.0.0-20231127134220-90b88e35bdb2
github.com/iotaledger/hive.go/app v0.0.0-20231127134220-90b88e35bdb2
github.com/iotaledger/hive.go/constraints v0.0.0-20231127134220-90b88e35bdb2
github.com/iotaledger/hive.go/constraints v0.0.0-20231128121006-331a9e522dfe
github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231127134220-90b88e35bdb2
github.com/iotaledger/hive.go/crypto v0.0.0-20231127134220-90b88e35bdb2
github.com/iotaledger/hive.go/crypto v0.0.0-20231128121006-331a9e522dfe
github.com/iotaledger/hive.go/ds v0.0.0-20231127134220-90b88e35bdb2
github.com/iotaledger/hive.go/ierrors v0.0.0-20231127134220-90b88e35bdb2
github.com/iotaledger/hive.go/ierrors v0.0.0-20231128121006-331a9e522dfe
github.com/iotaledger/hive.go/kvstore v0.0.0-20231127134220-90b88e35bdb2
github.com/iotaledger/hive.go/lo v0.0.0-20231127134220-90b88e35bdb2
github.com/iotaledger/hive.go/lo v0.0.0-20231128121006-331a9e522dfe
github.com/iotaledger/hive.go/logger v0.0.0-20231127134220-90b88e35bdb2
github.com/iotaledger/hive.go/runtime v0.0.0-20231127134220-90b88e35bdb2
github.com/iotaledger/hive.go/runtime v0.0.0-20231128121006-331a9e522dfe
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231127134220-90b88e35bdb2
github.com/iotaledger/hive.go/stringify v0.0.0-20231127134220-90b88e35bdb2
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231123103852-bb039cbab83b
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231123103318-f6ea945e2e98
github.com/iotaledger/iota.go/v4 v4.0.0-20231128160830-5582f462afb2
github.com/iotaledger/hive.go/stringify v0.0.0-20231128121006-331a9e522dfe
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231128163614-c82e1fa40733
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231128162307-cc6b309e93ef
github.com/iotaledger/iota.go/v4 v4.0.0-20231128162016-23f1b4e12cec
github.com/labstack/echo/v4 v4.11.3
github.com/labstack/gommon v0.4.1
github.com/libp2p/go-libp2p v0.32.0
Expand All @@ -41,7 +41,7 @@ require (
github.com/zyedidia/generic v1.2.1
go.uber.org/atomic v1.11.0
go.uber.org/dig v1.17.1
golang.org/x/crypto v0.15.0
golang.org/x/crypto v0.16.0
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.31.0
Expand Down Expand Up @@ -85,7 +85,7 @@ require (
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/holiman/uint256 v1.2.3 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/huin/goupnp v1.3.0 // indirect
github.com/iancoleman/orderedmap v0.3.0 // indirect
github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7 // indirect
Expand Down Expand Up @@ -171,14 +171,14 @@ require (
go.uber.org/zap v1.26.0 // indirect
golang.org/x/image v0.13.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.18.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.14.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.4.0 // indirect
golang.org/x/tools v0.14.0 // indirect
gonum.org/v1/gonum v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/blake3 v1.2.1 // indirect
Expand Down
56 changes: 28 additions & 28 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKe
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
github.com/hjson/hjson-go/v4 v4.0.0 h1:wlm6IYYqHjOdXH1gHev4VoXCaW20HdQAGCxdOEEg2cs=
github.com/hjson/hjson-go/v4 v4.0.0/go.mod h1:KaYt3bTw3zhBjYqnXkYywcYctk0A2nxeEFTse3rH13E=
github.com/holiman/uint256 v1.2.3 h1:K8UWO1HUJpRMXBxbmaY1Y8IAMZC/RsKB+ArEnnK4l5o=
github.com/holiman/uint256 v1.2.3/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw=
github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU=
github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E=
github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc=
github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8=
github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc=
Expand All @@ -279,36 +279,36 @@ github.com/iotaledger/hive.go/ads v0.0.0-20231127134220-90b88e35bdb2 h1:0FynHsnJ
github.com/iotaledger/hive.go/ads v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:gbUvr01B5ha530GnNm8K2OsHXOd2BtzBYOMxyTX3iDg=
github.com/iotaledger/hive.go/app v0.0.0-20231127134220-90b88e35bdb2 h1:WI6MQCxeANDyO7fOTovefuIusma+wT8VUJ3BisQLZEA=
github.com/iotaledger/hive.go/app v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:+riYmeLApkLlj4+EpuJpEJAsj/KGfD7cqLGy7oTsPOM=
github.com/iotaledger/hive.go/constraints v0.0.0-20231127134220-90b88e35bdb2 h1:8FPvPHWCNn54B3XpE3lOXAKwrh1LgPYTq0MnWZnk8vs=
github.com/iotaledger/hive.go/constraints v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s=
github.com/iotaledger/hive.go/constraints v0.0.0-20231128121006-331a9e522dfe h1:vgJj9kXM1IkLjbjWOV565Vil+RlzJwVhxG/KebMmrKE=
github.com/iotaledger/hive.go/constraints v0.0.0-20231128121006-331a9e522dfe/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s=
github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231127134220-90b88e35bdb2 h1:ZL4cGO4zy7IwCIfHQgpvu3yMbNnFFRvSvTqaZM5Uj5U=
github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20231127134220-90b88e35bdb2/go.mod h1:CdixkrB7VdQzEDlVuwsxPtsiJL/WXrQgz3PELIqlLko=
github.com/iotaledger/hive.go/crypto v0.0.0-20231127134220-90b88e35bdb2 h1:IcuTEC4KJhLkb5oMMZIzOOaM92U1KjWVbOZPyrmiasY=
github.com/iotaledger/hive.go/crypto v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:OQ9EVTTQT1mkO/16BgwSIyQlAhEg+Cptud/yutevWsI=
github.com/iotaledger/hive.go/crypto v0.0.0-20231128121006-331a9e522dfe h1:/+Qw7fe5oSE5Jxm8RPzcfBKHbwjJ/zwHu3UWdSOvKW8=
github.com/iotaledger/hive.go/crypto v0.0.0-20231128121006-331a9e522dfe/go.mod h1:OQ9EVTTQT1mkO/16BgwSIyQlAhEg+Cptud/yutevWsI=
github.com/iotaledger/hive.go/ds v0.0.0-20231127134220-90b88e35bdb2 h1:8YQlcFMexyYvjh3V/YSYzldeYjaDZd+1mHt8SUh8Uqs=
github.com/iotaledger/hive.go/ds v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:JE8cbZSvzbB5TrwXibg6M0B7ck35YxF30ItHBzQRlgc=
github.com/iotaledger/hive.go/ierrors v0.0.0-20231127134220-90b88e35bdb2 h1:ftGXnXLsaqRqnT1lb7ZMsbQRKc1o9Lyed/qCTpWVHvc=
github.com/iotaledger/hive.go/ierrors v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8=
github.com/iotaledger/hive.go/ierrors v0.0.0-20231128121006-331a9e522dfe h1:kVkjbdBANpA8tyu9RM4/GeyVoyRfGcb4LT96PqHTIWc=
github.com/iotaledger/hive.go/ierrors v0.0.0-20231128121006-331a9e522dfe/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8=
github.com/iotaledger/hive.go/kvstore v0.0.0-20231127134220-90b88e35bdb2 h1:b+AHpClIb7YAjpXgRHCsr+DRdBMuN4Q6k/wpFmT1wok=
github.com/iotaledger/hive.go/kvstore v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:ytfKoHr/nF8u0y0G4mamfG0yjFtJiJVk0kgjnPOtsSY=
github.com/iotaledger/hive.go/lo v0.0.0-20231127134220-90b88e35bdb2 h1:CTo8mb+RRZDBAz8RQFaJH7WxmOrj92Qe8boYHeTtPRk=
github.com/iotaledger/hive.go/lo v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:6Ee7i6b4tuTHuRYnPP8VUb0wr9XFI5qlqtnttBd9jRg=
github.com/iotaledger/hive.go/lo v0.0.0-20231128121006-331a9e522dfe h1:dQBQ+ZOVwC6KJxTABHMMHjJto70gNU5Cn4dXeJp5xmM=
github.com/iotaledger/hive.go/lo v0.0.0-20231128121006-331a9e522dfe/go.mod h1:6Ee7i6b4tuTHuRYnPP8VUb0wr9XFI5qlqtnttBd9jRg=
github.com/iotaledger/hive.go/log v0.0.0-20231127134220-90b88e35bdb2 h1:3B6UFIJ+IJEiGmUbLt5+Zokv0i8RUs70IuSR9sB60DA=
github.com/iotaledger/hive.go/log v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:vzO4/wRkEJDEZb/9fD10oKU9k1bj4qLir2Uhl5U1FkM=
github.com/iotaledger/hive.go/logger v0.0.0-20231127134220-90b88e35bdb2 h1:1r4fY+R9p2q5CzEkiXMuFr/UCM8RX3yPUllXkjm5/Fk=
github.com/iotaledger/hive.go/logger v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:w1psHM2MuKsen1WdsPKrpqElYH7ZOQ+YdQIgJZg4HTo=
github.com/iotaledger/hive.go/runtime v0.0.0-20231127134220-90b88e35bdb2 h1:a7MnddBEzQYqsRHRQbjqouAdqBuoCZY/G7EeIGbG/6E=
github.com/iotaledger/hive.go/runtime v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:DrZPvUvLarK8C2qb+3H2vdypp/MuhpQmB3iMJbDCr/Q=
github.com/iotaledger/hive.go/runtime v0.0.0-20231128121006-331a9e522dfe h1:jewR0RJ7oTGWjzhTROdIwhMeBH4//frUHizKs/6Em+s=
github.com/iotaledger/hive.go/runtime v0.0.0-20231128121006-331a9e522dfe/go.mod h1:DrZPvUvLarK8C2qb+3H2vdypp/MuhpQmB3iMJbDCr/Q=
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231127134220-90b88e35bdb2 h1:vTx/tPH+//CQcDjdC8DZv3s6x9KCqAfTqn3VTjYUUlw=
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231127134220-90b88e35bdb2/go.mod h1:FoH3T6yKlZJp8xm8K+zsQiibSynp32v21CpWx8xkek8=
github.com/iotaledger/hive.go/stringify v0.0.0-20231127134220-90b88e35bdb2 h1:kYle7Frgv1tAk4zss7wRVFmegZ0xjGIBIhwOzI0EFII=
github.com/iotaledger/hive.go/stringify v0.0.0-20231127134220-90b88e35bdb2/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231123103852-bb039cbab83b h1:T/9f4eYcP/fxe0G0pYa6TRZxD9rI9uMdDW89hnsNByU=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231123103852-bb039cbab83b/go.mod h1:c7ktZxoH5Wp2ixzJn/8RmM5v2QOCIu/79tDFvfLbyPs=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231123103318-f6ea945e2e98 h1:PjGs+njONeFaxFgQ3lxxlRs3wTYw3233f/yDyTV8/F8=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231123103318-f6ea945e2e98/go.mod h1:jFRt2SZO3KE74/mk+zeCjlhVROriEg86K8CJTxvfdP8=
github.com/iotaledger/iota.go/v4 v4.0.0-20231128160830-5582f462afb2 h1:1sEC/ow5sWfMom8ZJuXz4UIlqwOObmO9AvPxhFBFukc=
github.com/iotaledger/iota.go/v4 v4.0.0-20231128160830-5582f462afb2/go.mod h1:aO+5iL0vTNwNfE4QMGHVIufGziSI1wTvwJY1ipSMgCk=
github.com/iotaledger/hive.go/stringify v0.0.0-20231128121006-331a9e522dfe h1:RcFUqhnJ+86+sA0XMrZ0q+086ULrdWQkWrjUt2OnJK4=
github.com/iotaledger/hive.go/stringify v0.0.0-20231128121006-331a9e522dfe/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231128163614-c82e1fa40733 h1:jdjFTuMum+fctCq+UdEGk0pRi+JLqLm3cDMC9kUEPAs=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231128163614-c82e1fa40733/go.mod h1:3ae5TFi3uaECV+F4d5ekKz+xcJQmVtCICcs/Rhvgn3w=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231128162307-cc6b309e93ef h1:RImO23W0kL3U9egdLoi5OTmOIhE5rHfR/dKM/6XhZeE=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231128162307-cc6b309e93ef/go.mod h1:bi0zndM3irf8FHYUg6MzG/Zk/t0fV8IwGXAdoT7wn98=
github.com/iotaledger/iota.go/v4 v4.0.0-20231128162016-23f1b4e12cec h1:u9SAuKHygJwqwYxoEd+PyHCU4fTftcPdV2ZUGSRZe8o=
github.com/iotaledger/iota.go/v4 v4.0.0-20231128162016-23f1b4e12cec/go.mod h1:aO+5iL0vTNwNfE4QMGHVIufGziSI1wTvwJY1ipSMgCk=
github.com/ipfs/boxo v0.13.1 h1:nQ5oQzcMZR3oL41REJDcTbrvDvuZh3J9ckc9+ILeRQI=
github.com/ipfs/boxo v0.13.1/go.mod h1:btrtHy0lmO1ODMECbbEY1pxNtrLilvKSYLoGQt1yYCk=
github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s=
Expand Down Expand Up @@ -713,8 +713,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
Expand Down Expand Up @@ -757,8 +757,8 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8=
golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg=
golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ=
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
Expand Down Expand Up @@ -816,8 +816,8 @@ golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down Expand Up @@ -877,8 +877,8 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 h1:DC7wcm+i+P1rN3Ff07vL+OndGg5OhNddHyTA+ocPqYE=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM=
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
Expand Down
20 changes: 10 additions & 10 deletions pkg/retainer/block_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ type BlockMetadata struct {
TransactionFailureReason api.TransactionFailureReason
}

func (b *BlockMetadata) BlockMetadataResponse() *api.BlockMetadataResponse {
func (m *BlockMetadata) BlockMetadataResponse() *api.BlockMetadataResponse {
return &api.BlockMetadataResponse{
BlockID: b.BlockID,
BlockState: b.BlockState.String(),
BlockFailureReason: b.BlockFailureReason,
TransactionMetadata: b.TransactionMetadataResponse(),
BlockID: m.BlockID,
BlockState: m.BlockState.String(),
BlockFailureReason: m.BlockFailureReason,
TransactionMetadata: m.TransactionMetadataResponse(),
}
}

func (b *BlockMetadata) TransactionMetadataResponse() *api.TransactionMetadataResponse {
if b.TransactionState == api.TransactionStateNoTransaction {
func (m *BlockMetadata) TransactionMetadataResponse() *api.TransactionMetadataResponse {
if m.TransactionState == api.TransactionStateNoTransaction {
return nil
}

return &api.TransactionMetadataResponse{
TransactionID: b.TransactionID,
TransactionState: b.TransactionState.String(),
TransactionFailureReason: b.TransactionFailureReason,
TransactionID: m.TransactionID,
TransactionState: m.TransactionState.String(),
TransactionFailureReason: m.TransactionFailureReason,
}
}
Loading

0 comments on commit 2406726

Please sign in to comment.