Skip to content

Commit

Permalink
chore: remove dependency on wire from sql package
Browse files Browse the repository at this point in the history
  • Loading branch information
fasmat committed Aug 12, 2024
1 parent 16d8ac9 commit 5f84369
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions sql/atxs/atxs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 5f84369

Please sign in to comment.