solana-go/programs/system/InitializeNonceAccount_test.go

33 lines
738 B
Go
Raw Normal View History

package system
import (
"bytes"
"strconv"
"testing"
ag_gofuzz "github.com/gagliardetto/gofuzz"
ag_require "github.com/stretchr/testify/require"
)
func TestEncodeDecode_InitializeNonceAccount(t *testing.T) {
fu := ag_gofuzz.New().NilChance(0)
for i := 0; i < 1; i++ {
t.Run("InitializeNonceAccount"+strconv.Itoa(i), func(t *testing.T) {
{
params := new(InitializeNonceAccount)
fu.Fuzz(params)
params.AccountMetaSlice = nil
buf := new(bytes.Buffer)
err := encodeT(*params, buf)
ag_require.NoError(t, err)
//
got := new(InitializeNonceAccount)
err = decodeT(got, buf.Bytes())
got.AccountMetaSlice = nil
ag_require.NoError(t, err)
ag_require.Equal(t, params, got)
}
})
}
}