mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-28 23:27:36 +00:00
3aa858a69f
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
24 lines
594 B
Go
24 lines
594 B
Go
package transaction
|
|
|
|
import (
|
|
"encoding/base64"
|
|
"testing"
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/util"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func FuzzNewTransactionFromBytes(f *testing.F) {
|
|
b, err := base64.StdEncoding.DecodeString(rawInvocationTX)
|
|
require.NoError(f, err)
|
|
f.Add(b)
|
|
tx := New([]byte{0x51}, 1)
|
|
tx.Signers = []Signer{{Account: util.Uint160{1, 2, 3}}}
|
|
tx.Scripts = []Witness{{InvocationScript: []byte{}, VerificationScript: []byte{}}}
|
|
f.Add(tx.Bytes())
|
|
f.Fuzz(func(t *testing.T, b []byte) {
|
|
require.NotPanics(t, func() {
|
|
_, _ = NewTransactionFromBytes(b)
|
|
})
|
|
})
|
|
}
|