From c1fc3e1879203be3c0ea5d278e0c4eec0d25d9a8 Mon Sep 17 00:00:00 2001 From: Linus Gasser Date: Tue, 5 Mar 2024 13:55:58 +0100 Subject: [PATCH] Don't use the sync beforehand - the manager.Make takes care of that --- core/txn/pool/controller/action.go | 5 ----- core/txn/pool/controller/action_test.go | 9 +-------- core/txn/pool/controller/controller.go | 2 +- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/core/txn/pool/controller/action.go b/core/txn/pool/controller/action.go index 0baea8efb..15810ab92 100644 --- a/core/txn/pool/controller/action.go +++ b/core/txn/pool/controller/action.go @@ -62,11 +62,6 @@ func (a *addAction) Execute(ctx node.Context) error { manager := getManager(signer, a.client) - err = manager.Sync() - if err != nil { - return xerrors.Errorf("failed to sync manager: %v", err) - } - tx, err := manager.Make(args...) if err != nil { return xerrors.Errorf("creating transaction: %v", err) diff --git a/core/txn/pool/controller/action_test.go b/core/txn/pool/controller/action_test.go index 4865360cc..abad3cf41 100644 --- a/core/txn/pool/controller/action_test.go +++ b/core/txn/pool/controller/action_test.go @@ -48,19 +48,12 @@ func TestExecute(t *testing.T) { err = action.Execute(ctx) require.EqualError(t, err, "failed to include tx: "+fake.Err("failed to add")) - getManager = func(c crypto.Signer, s signed.Client) txn.Manager { - return badManager{} - } - - err = action.Execute(ctx) - require.EqualError(t, err, "creating transaction: "+fake.Err("make fail")) - getManager = func(c crypto.Signer, s signed.Client) txn.Manager { return badManager{failSync: true} } err = action.Execute(ctx) - require.EqualError(t, err, "failed to sync manager: "+fake.Err("sync fail")) + require.EqualError(t, err, "creating transaction: "+fake.Err("make fail")) err = os.WriteFile(keyFile, []byte("bad signer"), os.ModePerm) require.NoError(t, err) diff --git a/core/txn/pool/controller/controller.go b/core/txn/pool/controller/controller.go index 9d70373c1..921339509 100644 --- a/core/txn/pool/controller/controller.go +++ b/core/txn/pool/controller/controller.go @@ -63,7 +63,7 @@ func (miniController) OnStop(inj node.Injector) error { return nil } -// client return monotically increasing nonce +// client returns monotonically increasing nonce // // - implements signed.Client type client struct {