From 1d8d3103606c40416720c52e3b525c4b50eb5db9 Mon Sep 17 00:00:00 2001 From: Ivan Shvedunov Date: Tue, 13 Aug 2024 14:53:28 +0400 Subject: [PATCH] tmp: fix lint errors (will need to revert) --- activation/wire/wire_v2_test.go | 82 ++++++++++++++++----------------- 1 file changed, 40 insertions(+), 42 deletions(-) diff --git a/activation/wire/wire_v2_test.go b/activation/wire/wire_v2_test.go index e0303affb0..9c3cd5f3f6 100644 --- a/activation/wire/wire_v2_test.go +++ b/activation/wire/wire_v2_test.go @@ -1,58 +1,56 @@ package wire import ( - "math/rand/v2" "testing" fuzz "github.com/google/gofuzz" "github.com/stretchr/testify/require" "github.com/spacemeshos/go-spacemesh/common/types" - "github.com/spacemeshos/go-spacemesh/signing" ) -type testAtxV2Opt func(*ActivationTxV2) +// type testAtxV2Opt func(*ActivationTxV2) -func withMarriageCertificate(sig *signing.EdSigner, refAtx types.ATXID, atxPublisher types.NodeID) testAtxV2Opt { - return func(atx *ActivationTxV2) { - certificate := MarriageCertificate{ - ReferenceAtx: refAtx, - Signature: sig.Sign(signing.MARRIAGE, atxPublisher.Bytes()), - } - atx.Marriages = append(atx.Marriages, certificate) - } -} +// func withMarriageCertificate(sig *signing.EdSigner, refAtx types.ATXID, atxPublisher types.NodeID) testAtxV2Opt { +// return func(atx *ActivationTxV2) { +// certificate := MarriageCertificate{ +// ReferenceAtx: refAtx, +// Signature: sig.Sign(signing.MARRIAGE, atxPublisher.Bytes()), +// } +// atx.Marriages = append(atx.Marriages, certificate) +// } +// } -func newActivationTxV2(opts ...testAtxV2Opt) *ActivationTxV2 { - atx := &ActivationTxV2{ - PublishEpoch: rand.N(types.EpochID(255)), - PositioningATX: types.RandomATXID(), - PreviousATXs: make([]types.ATXID, 1+rand.IntN(255)), - NiPosts: []NiPostsV2{ - { - Membership: MerkleProofV2{ - Nodes: make([]types.Hash32, 32), - }, - Challenge: types.RandomHash(), - Posts: []SubPostV2{ - { - MarriageIndex: rand.Uint32N(256), - PrevATXIndex: 0, - Post: PostV1{ - Nonce: 0, - Indices: make([]byte, 800), - Pow: 0, - }, - }, - }, - }, - }, - } - for _, opt := range opts { - opt(atx) - } - return atx -} +// func newActivationTxV2(opts ...testAtxV2Opt) *ActivationTxV2 { +// atx := &ActivationTxV2{ +// PublishEpoch: rand.N(types.EpochID(255)), +// PositioningATX: types.RandomATXID(), +// PreviousATXs: make([]types.ATXID, 1+rand.IntN(255)), +// NiPosts: []NiPostsV2{ +// { +// Membership: MerkleProofV2{ +// Nodes: make([]types.Hash32, 32), +// }, +// Challenge: types.RandomHash(), +// Posts: []SubPostV2{ +// { +// MarriageIndex: rand.Uint32N(256), +// PrevATXIndex: 0, +// Post: PostV1{ +// Nonce: 0, +// Indices: make([]byte, 800), +// Pow: 0, +// }, +// }, +// }, +// }, +// }, +// } +// for _, opt := range opts { +// opt(atx) +// } +// return atx +// } func Benchmark_ATXv2ID(b *testing.B) { f := fuzz.New()