From 7514dcffbb50a7dfc6f19d94e128cc87766815d6 Mon Sep 17 00:00:00 2001 From: Michael Bisgaard Olesen Date: Sat, 10 Sep 2022 17:22:39 +0200 Subject: [PATCH] Alternative: Register mapper function of options instead of just the extra options The solution described in comment https://github.com/coinbase/rosetta-sdk-go/pull/423#discussion_r914876672. It mostly demonstrates that it adds too much complexity for what it gains. --- go.mod | 2 +- pkg/tester/data.go | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 8a40d6c2..d94dccb2 100644 --- a/go.mod +++ b/go.mod @@ -21,4 +21,4 @@ require ( github.com/btcsuite/btcd/btcutil v1.1.1 ) -replace github.com/coinbase/rosetta-sdk-go => github.com/Concordium/rosetta-sdk-go v0.7.11-0.20220706095914-7942ab456d4f +replace github.com/coinbase/rosetta-sdk-go => ../rosetta-sdk-go diff --git a/pkg/tester/data.go b/pkg/tester/data.go index 74fe927a..1e075faf 100644 --- a/pkg/tester/data.go +++ b/pkg/tester/data.go @@ -329,10 +329,14 @@ func InitializeData( statefulsyncer.WithMaxConcurrency(config.MaxSyncConcurrency), statefulsyncer.WithPastBlockLimit(config.MaxReorgDepth), statefulsyncer.WithSeenConcurrency(int64(config.SeenBlockWorkers)), - statefulsyncer.WithExtraSyncerOpts( - syncer.WithCustomHelper(func(h syncer.Helper) syncer.Helper { - return newConcordiumHelper(h) - }), + statefulsyncer.WithCustomSyncerOpts( + func(opts ...syncer.Option) []syncer.Option { + return append( + opts, + syncer.WithCustomHelper(func(h syncer.Helper) syncer.Helper { + return newConcordiumHelper(h) + })) + }, ), } if config.Data.PruningFrequency != nil {