[#907] morph/event/container: Define PutNamed event

Define `PutNamed` structure of notary notification from `putNamed` method of
Container contract. Embed `Put` type in order to inherit methods and
parsing of common parts with `put` method.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-10-12 17:42:04 +03:00 committed by Alex Vanin
parent 3173bf345e
commit a9494412da

View file

@ -47,6 +47,23 @@ func (p Put) NotaryRequest() *payload.P2PNotaryRequest {
return p.notaryRequest return p.notaryRequest
} }
// PutNamed represents notification event spawned by PutNamed method from Container contract of NeoFS Morph chain.
type PutNamed struct {
Put
name, zone string
}
// Name returns "name" arg of contract call.
func (x PutNamed) Name() string {
return x.name
}
// Zone returns "zone" arg of contract call.
func (x PutNamed) Zone() string {
return x.zone
}
// ParsePut from notification into container event structure. // ParsePut from notification into container event structure.
func ParsePut(params []stackitem.Item) (event.Event, error) { func ParsePut(params []stackitem.Item) (event.Event, error) {
var ( var (