From 5f84369a70dd862c4c42f069f9222ea5ac41ab55 Mon Sep 17 00:00:00 2001 From: Matthias <5011972+fasmat@users.noreply.github.com> Date: Mon, 12 Aug 2024 14:44:47 +0000 Subject: [PATCH] chore: remove dependency on wire from sql package --- sql/atxs/atxs_test.go | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/sql/atxs/atxs_test.go b/sql/atxs/atxs_test.go index eb507fe969a..4bd26e39759 100644 --- a/sql/atxs/atxs_test.go +++ b/sql/atxs/atxs_test.go @@ -11,8 +11,6 @@ import ( "github.com/stretchr/testify/require" "golang.org/x/exp/rand" - "github.com/spacemeshos/go-spacemesh/activation/wire" - "github.com/spacemeshos/go-spacemesh/common/fixture" "github.com/spacemeshos/go-spacemesh/common/types" "github.com/spacemeshos/go-spacemesh/signing" "github.com/spacemeshos/go-spacemesh/sql" @@ -824,22 +822,21 @@ func withCoinbase(addr types.Address) createAtxOpt { func newAtx(t testing.TB, signer *signing.EdSigner, opts ...createAtxOpt) (*types.ActivationTx, types.AtxBlob) { nonce := uint64(123) - watx := &wire.ActivationTxV1{ - InnerActivationTxV1: wire.InnerActivationTxV1{ - NIPostChallengeV1: wire.NIPostChallengeV1{ - PrevATXID: types.RandomATXID(), - }, - NumUnits: 2, - VRFNonce: &nonce, - }, + + atx := &types.ActivationTx{ + NumUnits: 2, + TickCount: 1, + VRFNonce: types.VRFPostIndex(nonce), + SmesherID: signer.NodeID(), } - watx.Sign(signer) + atx.SetID(types.RandomATXID()) + atx.SetReceived(time.Now().Local()) - atx := fixture.ToAtx(t, watx) for _, opt := range opts { opt(atx) } - return atx, watx.Blob() + blob := types.AtxBlob{Blob: types.RandomBytes(100)} + return atx, blob } type header struct {