Skip to content

Commit

Permalink
Remove unused commitmentFunc in commitmentfilter
Browse files Browse the repository at this point in the history
  • Loading branch information
muXxer committed Nov 21, 2023
1 parent b9f35d7 commit 1da92c1
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 19 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
github.com/iotaledger/hive.go/runtime v0.0.0-20231113110812-4ca2b6cc9a42
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20231113110812-4ca2b6cc9a42
github.com/iotaledger/hive.go/stringify v0.0.0-20231113110812-4ca2b6cc9a42
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231120094046-1308e2a5e072
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231121121055-b13a176c5180
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231120082637-ccd5b8465251
github.com/iotaledger/iota.go/v4 v4.0.0-20231120063545-80c263f28140
github.com/labstack/echo/v4 v4.11.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ 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-20231113110812-4ca2b6cc9a42 h1:9c7NiX2cnNPHR9UNWINDqNkolupXiDF3543pR6KLwIg=
github.com/iotaledger/hive.go/stringify v0.0.0-20231113110812-4ca2b6cc9a42/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231120094046-1308e2a5e072 h1:xbaW2dnDZy0ThcEcdK7ir3b+ynBXsn0R14lgxiFVuB0=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231120094046-1308e2a5e072/go.mod h1:iFiY6UukYeL8D3N1mtg4jh/9lxTBhzG0QgtD+w0gpps=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231121121055-b13a176c5180 h1:hAVWoyAF4FE+1gUd2IqvTBDTnQ4Z0GKE6qc8qw9QPqg=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231121121055-b13a176c5180/go.mod h1:iFiY6UukYeL8D3N1mtg4jh/9lxTBhzG0QgtD+w0gpps=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231120082637-ccd5b8465251 h1:bYGO8jXNXJNMGPG9etGW7WXfLbRU9ofx1xdd29/sS9M=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231120082637-ccd5b8465251/go.mod h1:chzj8FDIeXHIh3D52QTZ7imADlzdkhg7o7E2Qr85MJ8=
github.com/iotaledger/iota.go/v4 v4.0.0-20231120063545-80c263f28140 h1:8zHRYT1KADR9bOLUg7Ia4XA3StBHzV4Tb2Qtp42KLN8=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"github.com/iotaledger/hive.go/ierrors"
"github.com/iotaledger/hive.go/runtime/module"
"github.com/iotaledger/hive.go/runtime/options"
"github.com/iotaledger/iota-core/pkg/model"
"github.com/iotaledger/iota-core/pkg/protocol/engine"
"github.com/iotaledger/iota-core/pkg/protocol/engine/accounts"
"github.com/iotaledger/iota-core/pkg/protocol/engine/blocks"
Expand All @@ -19,9 +18,6 @@ type CommitmentFilter struct {

apiProvider iotago.APIProvider

// commitmentFunc is a function that returns the commitment corresponding to the given slot index.
commitmentFunc func(iotago.SlotIndex) (*model.Commitment, error)

rmcRetrieveFunc func(iotago.SlotIndex) (iotago.Mana, error)

accountRetrieveFunc func(accountID iotago.AccountID, targetIndex iotago.SlotIndex) (*accounts.AccountData, bool, error)
Expand All @@ -33,8 +29,6 @@ func NewProvider(opts ...options.Option[CommitmentFilter]) module.Provider[*engi
return module.Provide(func(e *engine.Engine) commitmentfilter.CommitmentFilter {
c := New(e, opts...)
e.HookConstructed(func() {
c.commitmentFunc = e.Storage.Commitments().Load

c.accountRetrieveFunc = e.Ledger.Account

e.Ledger.HookConstructed(func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ func NewTestFramework(t *testing.T, apiProvider iotago.APIProvider, optsFilter .
}
tf.CommitmentFilter = New(apiProvider, optsFilter...)

tf.CommitmentFilter.commitmentFunc = func(slot iotago.SlotIndex) (*model.Commitment, error) {
if commitment, ok := tf.commitments[slot]; ok {
return commitment, nil
}
return nil, ierrors.Errorf("no commitment available for slot index %d", slot)
}

tf.CommitmentFilter.accountRetrieveFunc = func(accountID iotago.AccountID, targetSlot iotago.SlotIndex) (*accounts.AccountData, bool, error) {
if accountData, ok := tf.accountData[accountID]; ok {
return accountData, true, nil
Expand Down
2 changes: 1 addition & 1 deletion tools/gendoc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ require (
github.com/iotaledger/hive.go/runtime v0.0.0-20231113110812-4ca2b6cc9a42 // 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-20231113110812-4ca2b6cc9a42 // indirect
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231120094046-1308e2a5e072 // indirect
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231121121055-b13a176c5180 // indirect
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231120082637-ccd5b8465251 // indirect
github.com/iotaledger/iota.go/v4 v4.0.0-20231120063545-80c263f28140 // indirect
github.com/ipfs/boxo v0.13.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions tools/gendoc/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ 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-20231113110812-4ca2b6cc9a42 h1:9c7NiX2cnNPHR9UNWINDqNkolupXiDF3543pR6KLwIg=
github.com/iotaledger/hive.go/stringify v0.0.0-20231113110812-4ca2b6cc9a42/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231120094046-1308e2a5e072 h1:xbaW2dnDZy0ThcEcdK7ir3b+ynBXsn0R14lgxiFVuB0=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231120094046-1308e2a5e072/go.mod h1:iFiY6UukYeL8D3N1mtg4jh/9lxTBhzG0QgtD+w0gpps=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231121121055-b13a176c5180 h1:hAVWoyAF4FE+1gUd2IqvTBDTnQ4Z0GKE6qc8qw9QPqg=
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20231121121055-b13a176c5180/go.mod h1:iFiY6UukYeL8D3N1mtg4jh/9lxTBhzG0QgtD+w0gpps=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231120082637-ccd5b8465251 h1:bYGO8jXNXJNMGPG9etGW7WXfLbRU9ofx1xdd29/sS9M=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20231120082637-ccd5b8465251/go.mod h1:chzj8FDIeXHIh3D52QTZ7imADlzdkhg7o7E2Qr85MJ8=
github.com/iotaledger/iota.go/v4 v4.0.0-20231120063545-80c263f28140 h1:8zHRYT1KADR9bOLUg7Ia4XA3StBHzV4Tb2Qtp42KLN8=
Expand Down

0 comments on commit 1da92c1

Please sign in to comment.