neo-go/pkg/core/state/notification_event_test.go

33 lines
793 B
Go
Raw Normal View History

package state
2019-11-26 15:47:07 +00:00
import (
"testing"
"github.com/nspcc-dev/neo-go/pkg/internal/random"
"github.com/nspcc-dev/neo-go/pkg/internal/testserdes"
"github.com/nspcc-dev/neo-go/pkg/smartcontract"
"github.com/nspcc-dev/neo-go/pkg/vm"
2019-11-26 15:47:07 +00:00
)
func TestEncodeDecodeNotificationEvent(t *testing.T) {
event := &NotificationEvent{
ScriptHash: random.Uint160(),
Item: vm.NewBoolItem(true),
2019-11-26 15:47:07 +00:00
}
testserdes.EncodeDecodeBinary(t, event, new(NotificationEvent))
2019-11-26 15:47:07 +00:00
}
func TestEncodeDecodeAppExecResult(t *testing.T) {
appExecResult := &AppExecResult{
TxHash: random.Uint256(),
2019-11-26 15:47:07 +00:00
Trigger: 1,
VMState: "Hault",
GasConsumed: 10,
Stack: []smartcontract.Parameter{},
2019-11-26 15:47:07 +00:00
Events: []NotificationEvent{},
}
testserdes.EncodeDecodeBinary(t, appExecResult, new(AppExecResult))
2019-11-26 15:47:07 +00:00
}