Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt to nodebridge changes #108

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions components/faucet/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var (

type dependencies struct {
dig.In
NodeBridge *nodebridge.NodeBridge
NodeBridge nodebridge.NodeBridge
Faucet *faucet.Faucet
ShutdownHandler *shutdown.ShutdownHandler
}
Expand All @@ -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
}
Expand All @@ -99,7 +92,7 @@ func provide(c *dig.Container) error {

type faucetDeps struct {
dig.In
NodeBridge *nodebridge.NodeBridge
NodeBridge nodebridge.NodeBridge
BlockIssuerClient nodeclient.BlockIssuerClient
}

Expand Down Expand Up @@ -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)),
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
6 changes: 3 additions & 3 deletions tools/gendoc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions tools/gendoc/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down