From 52ab7f93b99eb7982db620849e223ab962fa4544 Mon Sep 17 00:00:00 2001 From: Matthias <5011972+fasmat@users.noreply.github.com> Date: Thu, 29 Aug 2024 20:00:10 +0000 Subject: [PATCH] Cleanup --- activation/handler_v2_test.go | 14 +++++++------- activation/wire/malfeasance_double_marry.go | 4 ++-- activation/wire/wire_v2.go | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/activation/handler_v2_test.go b/activation/handler_v2_test.go index c1e0e527e0..d99b4e4c9c 100644 --- a/activation/handler_v2_test.go +++ b/activation/handler_v2_test.go @@ -1897,7 +1897,7 @@ func Test_CalculatingUnits(t *testing.T) { func TestContextual_PreviousATX(t *testing.T) { golden := types.RandomATXID() - atxHndlr := newV2TestHandler(t, golden) + atxHdlr := newV2TestHandler(t, golden) var ( signers []*signing.EdSigner eqSet []types.NodeID @@ -1909,13 +1909,13 @@ func TestContextual_PreviousATX(t *testing.T) { eqSet = append(eqSet, sig.NodeID()) } - mATX, otherAtxs := marryIDs(t, atxHndlr, signers, golden) + mATX, otherAtxs := marryIDs(t, atxHdlr, signers, golden) // signer 1 creates a solo ATX soloAtx := newSoloATXv2(t, mATX.PublishEpoch+1, otherAtxs[0].ID(), mATX.ID()) soloAtx.Sign(signers[1]) - atxHndlr.expectAtxV2(soloAtx) - err := atxHndlr.processATX(context.Background(), "", soloAtx, time.Now()) + atxHdlr.expectAtxV2(soloAtx) + err := atxHdlr.processATX(context.Background(), "", soloAtx, time.Now()) require.NoError(t, err) // create a MergedATX for all IDs @@ -1933,9 +1933,9 @@ func TestContextual_PreviousATX(t *testing.T) { merged.MarriageATX = &matxID merged.Sign(signers[0]) - atxHndlr.expectMergedAtxV2(merged, eqSet, []uint64{100}) - atxHndlr.mMalPublish.EXPECT().Publish(gomock.Any(), signers[1].NodeID(), gomock.Any()) - err = atxHndlr.processATX(context.Background(), "", merged, time.Now()) + atxHdlr.expectMergedAtxV2(merged, eqSet, []uint64{100}) + atxHdlr.mMalPublish.EXPECT().Publish(gomock.Any(), signers[1].NodeID(), gomock.Any()) + err = atxHdlr.processATX(context.Background(), "", merged, time.Now()) require.NoError(t, err) } diff --git a/activation/wire/malfeasance_double_marry.go b/activation/wire/malfeasance_double_marry.go index ea946b29ea..f0fb9d3628 100644 --- a/activation/wire/malfeasance_double_marry.go +++ b/activation/wire/malfeasance_double_marry.go @@ -58,7 +58,7 @@ func NewDoubleMarryProof(db sql.Executor, atx1, atx2 *ActivationTxV2, nodeID typ func createMarryProof(db sql.Executor, atx *ActivationTxV2, nodeID types.NodeID) (MarryProof, error) { marriageProof, err := marriageProof(atx) if err != nil { - return MarryProof{}, fmt.Errorf("failed to create proof for ATX 1: %w", err) + return MarryProof{}, fmt.Errorf("create proof for ATX: %w", err) } marriageIndex := slices.IndexFunc(atx.Marriages, func(cert MarriageCertificate) bool { @@ -77,7 +77,7 @@ func createMarryProof(db sql.Executor, atx *ActivationTxV2, nodeID types.NodeID) } certProof, err := certificateProof(atx.Marriages, uint64(marriageIndex)) if err != nil { - return MarryProof{}, fmt.Errorf("failed to create certificate proof for ATX 1: %w", err) + return MarryProof{}, fmt.Errorf("create certificate proof for ATX: %w", err) } proof := MarryProof{ diff --git a/activation/wire/wire_v2.go b/activation/wire/wire_v2.go index b3a5b11602..72c64d00f9 100644 --- a/activation/wire/wire_v2.go +++ b/activation/wire/wire_v2.go @@ -156,14 +156,14 @@ func (atx *ActivationTxV2) TotalNumUnits() uint32 { type MarriageCertificates []MarriageCertificate func (mcs MarriageCertificates) Root() []byte { - marriagesTree, err := merkle.NewTreeBuilder(). + tree, err := merkle.NewTreeBuilder(). WithHashFunc(atxTreeHash). Build() if err != nil { panic(err) } - mcs.merkleTree(marriagesTree) - return marriagesTree.Root() + mcs.merkleTree(tree) + return tree.Root() } func (mcs MarriageCertificates) merkleTree(tree *merkle.Tree) {