From 243be3c346cc14e317ed352c9d659f87e7e4c717 Mon Sep 17 00:00:00 2001 From: muXxer Date: Mon, 27 Nov 2023 17:24:07 +0100 Subject: [PATCH] Adapt to nodebridge changes --- components/faucet/component.go | 23 ++++++++--------------- go.mod | 6 +++--- go.sum | 12 ++++++------ tools/gendoc/go.mod | 6 +++--- tools/gendoc/go.sum | 12 ++++++------ 5 files changed, 26 insertions(+), 33 deletions(-) diff --git a/components/faucet/component.go b/components/faucet/component.go index f3b6a22..fdc4a51 100644 --- a/components/faucet/component.go +++ b/components/faucet/component.go @@ -52,7 +52,7 @@ var ( type dependencies struct { dig.In - NodeBridge *nodebridge.NodeBridge + NodeBridge nodebridge.NodeBridge Faucet *faucet.Faucet ShutdownHandler *shutdown.ShutdownHandler } @@ -69,23 +69,16 @@ func provide(c *dig.Container) error { // get the block issuer client type blockIssuerClientDeps struct { dig.In - NodeBridge *nodebridge.NodeBridge + NodeBridge nodebridge.NodeBridge } if err := c.Provide(func(deps blockIssuerClientDeps) (nodeclient.BlockIssuerClient, error) { - Component.LogInfo("Initializing INX node client...") - nodeClient, err := deps.NodeBridge.INXNodeClient() - if err != nil { - return nil, err - } - Component.LogInfo("Initializing INX node client...done!") - ctx, cancel := context.WithTimeout(Component.Daemon().ContextStopped(), 5*time.Second) defer cancel() Component.LogInfo("Initializing blockissuer...") - blockissuer, err := nodeClient.BlockIssuer(ctx) + blockissuer, err := deps.NodeBridge.BlockIssuer(ctx) if err != nil { return nil, err } @@ -99,7 +92,7 @@ func provide(c *dig.Container) error { type faucetDeps struct { dig.In - NodeBridge *nodebridge.NodeBridge + NodeBridge nodebridge.NodeBridge BlockIssuerClient nodeclient.BlockIssuerClient } @@ -279,7 +272,7 @@ func provide(c *dig.Container) error { faucetAddressRestricted, faucetSigner, faucet.WithLogger(Component.Logger()), - faucet.WithTokenName(deps.NodeBridge.NodeConfig.BaseToken.Name), + faucet.WithTokenName(deps.NodeBridge.NodeConfig().BaseToken.Name), faucet.WithBaseTokenAmount(iotago.BaseToken(ParamsFaucet.BaseTokenAmount)), faucet.WithBaseTokenAmountSmall(iotago.BaseToken(ParamsFaucet.BaseTokenAmountSmall)), faucet.WithBaseTokenAmountMaxTarget(iotago.BaseToken(ParamsFaucet.BaseTokenAmountMaxTarget)), @@ -309,11 +302,11 @@ func run() error { // outputs that are created and consumed in the same update exist in both maps. createdOutputs := make(map[iotago.OutputID]struct{}) for _, output := range tx.Created { - createdOutputs[output.UnwrapOutputID()] = types.Void + createdOutputs[output.OutputID] = types.Void } consumedOutputs := make(map[iotago.OutputID]struct{}) - for _, spent := range tx.Consumed { - consumedOutputs[spent.GetOutput().UnwrapOutputID()] = types.Void + for _, output := range tx.Consumed { + consumedOutputs[output.OutputID] = types.Void } err := deps.Faucet.ApplyAcceptedTransaction(createdOutputs, consumedOutputs) diff --git a/go.mod b/go.mod index bd4737e..dfab759 100644 --- a/go.mod +++ b/go.mod @@ -11,9 +11,9 @@ require ( github.com/iotaledger/hive.go/lo v0.0.0-20231122112629-bdf1cc39fba7 github.com/iotaledger/hive.go/logger v0.0.0-20231113110812-4ca2b6cc9a42 github.com/iotaledger/hive.go/runtime v0.0.0-20231122112629-bdf1cc39fba7 - 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-20231124100551-bb617f46bb49 + github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231127162144-bba7e494e442 + github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231124154447-f20fb8921e8c + github.com/iotaledger/iota.go/v4 v4.0.0-20231124103306-ad44904e2b86 github.com/labstack/echo/v4 v4.11.3 go.uber.org/dig v1.17.1 golang.org/x/time v0.4.0 diff --git a/go.sum b/go.sum index 77873d7..c6b22f5 100644 --- a/go.sum +++ b/go.sum @@ -206,12 +206,12 @@ github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231113110812-4ca2b6c github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231113110812-4ca2b6cc9a42/go.mod h1:FoH3T6yKlZJp8xm8K+zsQiibSynp32v21CpWx8xkek8= github.com/iotaledger/hive.go/stringify v0.0.0-20231122112629-bdf1cc39fba7 h1:h481Dn+giKO/1MamwuDZ8Mvzg4GbPx/asKD/X3Zs8wc= github.com/iotaledger/hive.go/stringify v0.0.0-20231122112629-bdf1cc39fba7/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-20231124100551-bb617f46bb49 h1:xdsynMvuo1KcFCjvuUH8ekh6zigKnOj+/j/WrvHaDxU= -github.com/iotaledger/iota.go/v4 v4.0.0-20231124100551-bb617f46bb49/go.mod h1:aO+5iL0vTNwNfE4QMGHVIufGziSI1wTvwJY1ipSMgCk= +github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231127162144-bba7e494e442 h1:izm0bwyHjas8T76MTTvzy3xG96iZ1Hk1QfsGk1eS2Cs= +github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231127162144-bba7e494e442/go.mod h1:iL2W0qVT3gUKEEKSDuuvVWK0wj4iJMPR0rDEiPUDI2A= +github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231124154447-f20fb8921e8c h1:BS7T2gXCJQeXyLZ3fLHbX8HJDx9zDAnj5P1ZB/5XahY= +github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231124154447-f20fb8921e8c/go.mod h1:WsNHyemrN5A9GIlmQMEB0mpqU8SymMZaaKBfhV31y5k= +github.com/iotaledger/iota.go/v4 v4.0.0-20231124103306-ad44904e2b86 h1:vIQemhyUKXzLtmuyadp2VAwg2lGGYciIjRIqWSMs/30= +github.com/iotaledger/iota.go/v4 v4.0.0-20231124103306-ad44904e2b86/go.mod h1:aO+5iL0vTNwNfE4QMGHVIufGziSI1wTvwJY1ipSMgCk= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= diff --git a/tools/gendoc/go.mod b/tools/gendoc/go.mod index ada7142..de10b68 100644 --- a/tools/gendoc/go.mod +++ b/tools/gendoc/go.mod @@ -44,9 +44,9 @@ require ( github.com/iotaledger/hive.go/runtime v0.0.0-20231122112629-bdf1cc39fba7 // indirect github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231113110812-4ca2b6cc9a42 // indirect github.com/iotaledger/hive.go/stringify v0.0.0-20231122112629-bdf1cc39fba7 // indirect - github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231123103852-bb039cbab83b // indirect - github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231123103318-f6ea945e2e98 // indirect - github.com/iotaledger/iota.go/v4 v4.0.0-20231124100551-bb617f46bb49 // indirect + github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231127162144-bba7e494e442 // indirect + github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231124154447-f20fb8921e8c // indirect + github.com/iotaledger/iota.go/v4 v4.0.0-20231124103306-ad44904e2b86 // indirect github.com/knadh/koanf v1.5.0 // indirect github.com/kr/text v0.2.0 // indirect github.com/labstack/echo/v4 v4.11.3 // indirect diff --git a/tools/gendoc/go.sum b/tools/gendoc/go.sum index 2bab881..84f98fd 100644 --- a/tools/gendoc/go.sum +++ b/tools/gendoc/go.sum @@ -210,12 +210,12 @@ github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231113110812-4ca2b6c github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231113110812-4ca2b6cc9a42/go.mod h1:FoH3T6yKlZJp8xm8K+zsQiibSynp32v21CpWx8xkek8= github.com/iotaledger/hive.go/stringify v0.0.0-20231122112629-bdf1cc39fba7 h1:h481Dn+giKO/1MamwuDZ8Mvzg4GbPx/asKD/X3Zs8wc= github.com/iotaledger/hive.go/stringify v0.0.0-20231122112629-bdf1cc39fba7/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-20231124100551-bb617f46bb49 h1:xdsynMvuo1KcFCjvuUH8ekh6zigKnOj+/j/WrvHaDxU= -github.com/iotaledger/iota.go/v4 v4.0.0-20231124100551-bb617f46bb49/go.mod h1:aO+5iL0vTNwNfE4QMGHVIufGziSI1wTvwJY1ipSMgCk= +github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231127162144-bba7e494e442 h1:izm0bwyHjas8T76MTTvzy3xG96iZ1Hk1QfsGk1eS2Cs= +github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231127162144-bba7e494e442/go.mod h1:iL2W0qVT3gUKEEKSDuuvVWK0wj4iJMPR0rDEiPUDI2A= +github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231124154447-f20fb8921e8c h1:BS7T2gXCJQeXyLZ3fLHbX8HJDx9zDAnj5P1ZB/5XahY= +github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231124154447-f20fb8921e8c/go.mod h1:WsNHyemrN5A9GIlmQMEB0mpqU8SymMZaaKBfhV31y5k= +github.com/iotaledger/iota.go/v4 v4.0.0-20231124103306-ad44904e2b86 h1:vIQemhyUKXzLtmuyadp2VAwg2lGGYciIjRIqWSMs/30= +github.com/iotaledger/iota.go/v4 v4.0.0-20231124103306-ad44904e2b86/go.mod h1:aO+5iL0vTNwNfE4QMGHVIufGziSI1wTvwJY1ipSMgCk= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=