neoneo-go/pkg/rpc/response/result/subscriptions/notification_event_test.go
Anna Shaleva b3ea7504cb subscriptions: add container hash to notification event
External users make use of it. Close #2190.
2021-09-24 17:42:02 +03:00

21 lines
626 B
Go

package subscriptions
import (
"testing"
"github.com/nspcc-dev/neo-go/internal/testserdes"
"github.com/nspcc-dev/neo-go/pkg/core/state"
"github.com/nspcc-dev/neo-go/pkg/util"
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
)
func TestNotificationEvent_MarshalUnmarshalJSON(t *testing.T) {
testserdes.MarshalUnmarshalJSON(t, &NotificationEvent{
Container: util.Uint256{1, 2, 3},
NotificationEvent: state.NotificationEvent{
ScriptHash: util.Uint160{4, 5, 6},
Name: "alarm",
Item: stackitem.NewArray([]stackitem.Item{stackitem.NewByteArray([]byte("qwerty"))}),
},
}, new(NotificationEvent))
}