diff --git a/cmd/accumulated/run/instrumentation.go b/cmd/accumulated/run/instrumentation.go index 934a58387..b6ef1bd86 100644 --- a/cmd/accumulated/run/instrumentation.go +++ b/cmd/accumulated/run/instrumentation.go @@ -45,6 +45,7 @@ func (i *Instrumentation) listen(inst *Instance) error { if i == nil || len(i.Listen) == 0 { return nil } + i.applyHttpDefaults() _, err := i.startHTTP(inst, promhttp.InstrumentMetricHandler( prometheus.DefaultRegisterer, promhttp.HandlerFor( prometheus.DefaultGatherer, diff --git a/cmd/accumulated/run/types_gen.go b/cmd/accumulated/run/types_gen.go index 373471d7f..090d732bb 100644 --- a/cmd/accumulated/run/types_gen.go +++ b/cmd/accumulated/run/types_gen.go @@ -2200,6 +2200,7 @@ func (v *HttpPeerMapEntry) MarshalJSON() ([]byte, error) { ID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"id,omitempty"` Partitions encoding.JsonList[string] `json:"partitions,omitempty"` Addresses *encoding.JsonUnmarshalListWith[p2p.Multiaddr] `json:"addresses,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.ID == ("")) { u.ID = &encoding.JsonUnmarshalWith[p2p.PeerID]{Value: v.ID, Func: p2p.UnmarshalPeerIDJSON} @@ -2210,6 +2211,7 @@ func (v *HttpPeerMapEntry) MarshalJSON() ([]byte, error) { if !(len(v.Addresses) == 0) { u.Addresses = &encoding.JsonUnmarshalListWith[p2p.Multiaddr]{Value: v.Addresses, Func: p2p.UnmarshalMultiaddrJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2229,25 +2231,20 @@ func (v *HttpService) MarshalJSON() ([]byte, error) { }{} u.Type = v.Type() if !(len(v.HttpListener.Listen) == 0) { - u.Listen = &encoding.JsonUnmarshalListWith[p2p.Multiaddr]{Value: v.HttpListener.Listen, Func: p2p.UnmarshalMultiaddrJSON} } if !(v.HttpListener.ConnectionLimit == nil) { - u.ConnectionLimit = v.HttpListener.ConnectionLimit } if !(v.HttpListener.ReadHeaderTimeout == nil) { - if v.HttpListener.ReadHeaderTimeout != nil { u.ReadHeaderTimeout = encoding.DurationToJSON(*v.HttpListener.ReadHeaderTimeout) } } if !(len(v.HttpListener.TlsCertPath) == 0) { - u.TlsCertPath = v.HttpListener.TlsCertPath } if !(len(v.HttpListener.TlsKeyPath) == 0) { - u.TlsKeyPath = v.HttpListener.TlsKeyPath } if !(len(v.CorsOrigins) == 0) { @@ -2278,25 +2275,20 @@ func (v *Instrumentation) MarshalJSON() ([]byte, error) { Monitoring *Monitor `json:"monitoring,omitempty"` }{} if !(len(v.HttpListener.Listen) == 0) { - u.Listen = &encoding.JsonUnmarshalListWith[p2p.Multiaddr]{Value: v.HttpListener.Listen, Func: p2p.UnmarshalMultiaddrJSON} } if !(v.HttpListener.ConnectionLimit == nil) { - u.ConnectionLimit = v.HttpListener.ConnectionLimit } if !(v.HttpListener.ReadHeaderTimeout == nil) { - if v.HttpListener.ReadHeaderTimeout != nil { u.ReadHeaderTimeout = encoding.DurationToJSON(*v.HttpListener.ReadHeaderTimeout) } } if !(len(v.HttpListener.TlsCertPath) == 0) { - u.TlsCertPath = v.HttpListener.TlsCertPath } if !(len(v.HttpListener.TlsKeyPath) == 0) { - u.TlsKeyPath = v.HttpListener.TlsKeyPath } if !(v.Monitoring == nil) { @@ -2483,10 +2475,11 @@ func (v *RawPrivateKey) MarshalJSON() ([]byte, error) { func (v *RouterService) MarshalJSON() ([]byte, error) { u := struct { - Type ServiceType `json:"type"` - Name string `json:"name,omitempty"` - Events string `json:"events,omitempty"` - PeerMap encoding.JsonList[*HttpPeerMapEntry] `json:"peerMap,omitempty"` + Type ServiceType `json:"type"` + Name string `json:"name,omitempty"` + Events string `json:"events,omitempty"` + PeerMap encoding.JsonList[*HttpPeerMapEntry] `json:"peerMap,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.Name) == 0) { @@ -2498,6 +2491,7 @@ func (v *RouterService) MarshalJSON() ([]byte, error) { if !(len(v.PeerMap) == 0) { u.PeerMap = v.PeerMap } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2586,7 +2580,8 @@ func (v *BadgerStorage) UnmarshalJSON(data []byte) error { u.Type = v.Type() u.Path = v.Path u.Version = v.Version - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2604,7 +2599,8 @@ func (v *BoltStorage) UnmarshalJSON(data []byte) error { }{} u.Type = v.Type() u.Path = v.Path - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2620,8 +2616,10 @@ func (v *CometNodeKeyFile) UnmarshalJSON(data []byte) error { Path string `json:"path,omitempty"` }{} u.Type = v.Type() + u.Path = v.Path - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2637,8 +2635,10 @@ func (v *CometPrivValFile) UnmarshalJSON(data []byte) error { Path string `json:"path,omitempty"` }{} u.Type = v.Type() + u.Path = v.Path - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2657,13 +2657,15 @@ func (v *Config) UnmarshalJSON(data []byte) error { Configurations *encoding.JsonUnmarshalListWith[Configuration] `json:"configurations,omitempty"` Services *encoding.JsonUnmarshalListWith[Service] `json:"services,omitempty"` }{} + u.Network = v.Network u.Logging = v.Logging u.Instrumentation = v.Instrumentation u.P2P = v.P2P u.Configurations = &encoding.JsonUnmarshalListWith[Configuration]{Value: v.Configurations, Func: UnmarshalConfigurationJSON} u.Services = &encoding.JsonUnmarshalListWith[Service]{Value: v.Services, Func: UnmarshalServiceJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Network = u.Network @@ -2704,7 +2706,8 @@ func (v *ConsensusService) UnmarshalJSON(data []byte) error { u.BootstrapPeers = &encoding.JsonUnmarshalListWith[p2p.Multiaddr]{Value: v.BootstrapPeers, Func: p2p.UnmarshalMultiaddrJSON} u.MetricsNamespace = v.MetricsNamespace u.App = &encoding.JsonUnmarshalWith[ConsensusApp]{Value: v.App, Func: UnmarshalConsensusAppJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2747,7 +2750,8 @@ func (v *CoreConsensusApp) UnmarshalJSON(data []byte) error { u.EnableHealing = v.EnableHealing u.EnableDirectDispatch = v.EnableDirectDispatch u.MaxEnvelopesPerBlock = v.MaxEnvelopesPerBlock - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2791,7 +2795,8 @@ func (v *CoreValidatorConfiguration) UnmarshalJSON(data []byte) error { u.EnableSnapshots = v.EnableSnapshots u.MaxEnvelopesPerBlock = v.MaxEnvelopesPerBlock u.StorageType = v.StorageType - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2844,7 +2849,8 @@ func (v *DevnetConfiguration) UnmarshalJSON(data []byte) error { u.Validators = v.Validators u.Followers = v.Followers u.Globals = v.Globals - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2868,7 +2874,8 @@ func (v *EventsService) UnmarshalJSON(data []byte) error { }{} u.Type = v.Type() u.Partition = v.Partition - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2885,7 +2892,8 @@ func (v *ExpBlockDBStorage) UnmarshalJSON(data []byte) error { }{} u.Type = v.Type() u.Path = v.Path - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2906,7 +2914,8 @@ func (v *FaucetService) UnmarshalJSON(data []byte) error { u.Account = v.Account u.SigningKey = &encoding.JsonUnmarshalWith[PrivateKey]{Value: v.SigningKey, Func: UnmarshalPrivateKeyJSON} u.Router = v.Router - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2928,7 +2937,8 @@ func (v *GatewayConfiguration) UnmarshalJSON(data []byte) error { }{} u.Type = v.Type() u.Listen = &encoding.JsonUnmarshalWith[p2p.Multiaddr]{Value: v.Listen, Func: p2p.UnmarshalMultiaddrJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2956,7 +2966,8 @@ func (v *HttpListener) UnmarshalJSON(data []byte) error { } u.TlsCertPath = v.TlsCertPath u.TlsKeyPath = v.TlsKeyPath - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if u.Listen != nil { @@ -2983,11 +2994,13 @@ func (v *HttpPeerMapEntry) UnmarshalJSON(data []byte) error { ID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"id,omitempty"` Partitions encoding.JsonList[string] `json:"partitions,omitempty"` Addresses *encoding.JsonUnmarshalListWith[p2p.Multiaddr] `json:"addresses,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.ID = &encoding.JsonUnmarshalWith[p2p.PeerID]{Value: v.ID, Func: p2p.UnmarshalPeerIDJSON} u.Partitions = v.Partitions u.Addresses = &encoding.JsonUnmarshalListWith[p2p.Multiaddr]{Value: v.Addresses, Func: p2p.UnmarshalMultiaddrJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if u.ID != nil { @@ -3001,6 +3014,10 @@ func (v *HttpPeerMapEntry) UnmarshalJSON(data []byte) error { v.Addresses[i] = x } } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -3031,7 +3048,8 @@ func (v *HttpService) UnmarshalJSON(data []byte) error { u.DebugJsonRpc = v.DebugJsonRpc u.Router = v.Router u.PeerMap = v.PeerMap - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3078,7 +3096,8 @@ func (v *Instrumentation) UnmarshalJSON(data []byte) error { u.TlsCertPath = v.HttpListener.TlsCertPath u.TlsKeyPath = v.HttpListener.TlsKeyPath u.Monitoring = v.Monitoring - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if u.Listen != nil { @@ -3108,7 +3127,8 @@ func (v *LevelDBStorage) UnmarshalJSON(data []byte) error { }{} u.Type = v.Type() u.Path = v.Path - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3129,7 +3149,8 @@ func (v *Logging) UnmarshalJSON(data []byte) error { u.Color = v.Color u.Rules = v.Rules u.Loki = v.Loki - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Format = u.Format @@ -3146,7 +3167,8 @@ func (v *LoggingRule) UnmarshalJSON(data []byte) error { }{} u.Level = v.Level u.Modules = v.Modules - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Level = u.Level @@ -3159,7 +3181,8 @@ func (v *MemoryStorage) UnmarshalJSON(data []byte) error { Type StorageType `json:"type"` }{} u.Type = v.Type() - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3175,7 +3198,8 @@ func (v *MetricsService) UnmarshalJSON(data []byte) error { }{} u.Type = v.Type() u.Partition = v.Partition - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3198,7 +3222,8 @@ func (v *Monitor) UnmarshalJSON(data []byte) error { u.MemoryPollingRate = encoding.DurationToJSON(*v.MemoryPollingRate) } u.AllocRateTrigger = v.AllocRateTrigger - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Directory = u.Directory @@ -3221,7 +3246,8 @@ func (v *NetworkService) UnmarshalJSON(data []byte) error { }{} u.Type = v.Type() u.Partition = v.Partition - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3248,7 +3274,8 @@ func (v *P2P) UnmarshalJSON(data []byte) error { u.EnablePeerTracking = v.EnablePeerTracking u.DiscoveryMode = v.DiscoveryMode u.External = &encoding.JsonUnmarshalWith[p2p.Multiaddr]{Value: v.External, Func: p2p.UnmarshalMultiaddrJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if u.Listen != nil { @@ -3283,8 +3310,10 @@ func (v *PrivateKeySeed) UnmarshalJSON(data []byte) error { Seed *record.Key `json:"seed,omitempty"` }{} u.Type = v.Type() + u.Seed = v.Seed - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3303,7 +3332,8 @@ func (v *Querier) UnmarshalJSON(data []byte) error { u.Type = v.Type() u.Partition = v.Partition u.Storage = v.Storage - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3321,7 +3351,8 @@ func (v *RawPrivateKey) UnmarshalJSON(data []byte) error { }{} u.Type = v.Type() u.Address = v.Address - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3333,16 +3364,18 @@ func (v *RawPrivateKey) UnmarshalJSON(data []byte) error { func (v *RouterService) UnmarshalJSON(data []byte) error { u := struct { - Type ServiceType `json:"type"` - Name string `json:"name,omitempty"` - Events string `json:"events,omitempty"` - PeerMap encoding.JsonList[*HttpPeerMapEntry] `json:"peerMap,omitempty"` + Type ServiceType `json:"type"` + Name string `json:"name,omitempty"` + Events string `json:"events,omitempty"` + PeerMap encoding.JsonList[*HttpPeerMapEntry] `json:"peerMap,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Name = v.Name u.Events = v.Events u.PeerMap = v.PeerMap - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3351,6 +3384,10 @@ func (v *RouterService) UnmarshalJSON(data []byte) error { v.Name = u.Name v.Events = u.Events v.PeerMap = u.PeerMap + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -3371,7 +3408,8 @@ func (v *SnapshotService) UnmarshalJSON(data []byte) error { u.Schedule = v.Schedule u.RetainCount = v.RetainCount u.EnableIndexing = v.EnableIndexing - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3395,7 +3433,8 @@ func (v *StorageService) UnmarshalJSON(data []byte) error { u.Type = v.Type() u.Name = v.Name u.Storage = &encoding.JsonUnmarshalWith[Storage]{Value: v.Storage, Func: UnmarshalStorageJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3420,7 +3459,8 @@ func (v *SubnodeService) UnmarshalJSON(data []byte) error { u.Name = v.Name u.NodeKey = &encoding.JsonUnmarshalWith[PrivateKey]{Value: v.NodeKey, Func: UnmarshalPrivateKeyJSON} u.Services = &encoding.JsonUnmarshalListWith[Service]{Value: v.Services, Func: UnmarshalServiceJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3445,7 +3485,9 @@ func (v *TransientPrivateKey) UnmarshalJSON(data []byte) error { Type PrivateKeyType `json:"type"` }{} u.Type = v.Type() - if err := json.Unmarshal(data, &u); err != nil { + + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { diff --git a/internal/api/private/types_gen.go b/internal/api/private/types_gen.go index 7c010d28c..c898daa20 100644 --- a/internal/api/private/types_gen.go +++ b/internal/api/private/types_gen.go @@ -123,25 +123,33 @@ func (v *SequenceOptions) UnmarshalBinaryFrom(rd io.Reader) error { func (v *SequenceOptions) MarshalJSON() ([]byte, error) { u := struct { - NodeID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"nodeID,omitempty"` + NodeID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"nodeID,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.NodeID == ("")) { u.NodeID = &encoding.JsonUnmarshalWith[p2p.PeerID]{Value: v.NodeID, Func: p2p.UnmarshalPeerIDJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *SequenceOptions) UnmarshalJSON(data []byte) error { u := struct { - NodeID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"nodeID,omitempty"` + NodeID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"nodeID,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.NodeID = &encoding.JsonUnmarshalWith[p2p.PeerID]{Value: v.NodeID, Func: p2p.UnmarshalPeerIDJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if u.NodeID != nil { v.NodeID = u.NodeID.Value } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } diff --git a/internal/api/v2/types_gen.go b/internal/api/v2/types_gen.go index 57f704c9d..b05ea78ee 100644 --- a/internal/api/v2/types_gen.go +++ b/internal/api/v2/types_gen.go @@ -2876,11 +2876,12 @@ func (v *ChainQueryResponse) MarshalJSON() ([]byte, error) { func (v *ChainState) MarshalJSON() ([]byte, error) { u := struct { - Name string `json:"name,omitempty"` - Type protocol.ChainType `json:"type,omitempty"` - Height uint64 `json:"height,omitempty"` - Count uint64 `json:"count,omitempty"` - Roots encoding.JsonList[*string] `json:"roots,omitempty"` + Name string `json:"name,omitempty"` + Type protocol.ChainType `json:"type,omitempty"` + Height uint64 `json:"height,omitempty"` + Count uint64 `json:"count,omitempty"` + Roots encoding.JsonList[*string] `json:"roots,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Name) == 0) { u.Name = v.Name @@ -2898,6 +2899,7 @@ func (v *ChainState) MarshalJSON() ([]byte, error) { u.Roots[i] = encoding.BytesToJSON(x) } } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2905,6 +2907,7 @@ func (v *DataEntryQuery) MarshalJSON() ([]byte, error) { u := struct { Url *url.URL `json:"url,omitempty"` EntryHash *string `json:"entryHash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Url == nil) { u.Url = v.Url @@ -2912,6 +2915,7 @@ func (v *DataEntryQuery) MarshalJSON() ([]byte, error) { if !(v.EntryHash == ([32]byte{})) { u.EntryHash = encoding.ChainToJSON(&v.EntryHash) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2922,6 +2926,7 @@ func (v *DataEntryQueryResponse) MarshalJSON() ([]byte, error) { TxId *url.TxID `json:"txId,omitempty"` CauseTxId *url.TxID `json:"causeTxId,omitempty"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.EntryHash == ([32]byte{})) { u.EntryHash = encoding.ChainToJSON(&v.EntryHash) @@ -2938,6 +2943,7 @@ func (v *DataEntryQueryResponse) MarshalJSON() ([]byte, error) { if !(v.LastBlockTime == nil) { u.LastBlockTime = v.LastBlockTime } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2954,36 +2960,28 @@ func (v *DataEntrySetQuery) MarshalJSON() ([]byte, error) { IncludeRemote bool `json:"includeRemote,omitempty"` }{} if !(v.UrlQuery.Url == nil) { - u.Url = v.UrlQuery.Url } if !(v.QueryPagination.Start == 0) { - u.Start = v.QueryPagination.Start } if !(v.QueryPagination.Count == 0) { - u.Count = v.QueryPagination.Count } if !(!v.QueryOptions.Expand) { - u.Expand = v.QueryOptions.Expand u.ExpandChains = v.QueryOptions.Expand } if !(v.QueryOptions.Height == 0) { - u.Height = v.QueryOptions.Height } if !(!v.QueryOptions.Scratch) { - u.Scratch = v.QueryOptions.Scratch } if !(!v.QueryOptions.Prove) { - u.Prove = v.QueryOptions.Prove } if !(!v.QueryOptions.IncludeRemote) { - u.IncludeRemote = v.QueryOptions.IncludeRemote } return json.Marshal(&u) @@ -3032,36 +3030,28 @@ func (v *DirectoryQuery) MarshalJSON() ([]byte, error) { IncludeRemote bool `json:"includeRemote,omitempty"` }{} if !(v.UrlQuery.Url == nil) { - u.Url = v.UrlQuery.Url } if !(v.QueryPagination.Start == 0) { - u.Start = v.QueryPagination.Start } if !(v.QueryPagination.Count == 0) { - u.Count = v.QueryPagination.Count } if !(!v.QueryOptions.Expand) { - u.Expand = v.QueryOptions.Expand u.ExpandChains = v.QueryOptions.Expand } if !(v.QueryOptions.Height == 0) { - u.Height = v.QueryOptions.Height } if !(!v.QueryOptions.Scratch) { - u.Scratch = v.QueryOptions.Scratch } if !(!v.QueryOptions.Prove) { - u.Prove = v.QueryOptions.Prove } if !(!v.QueryOptions.IncludeRemote) { - u.IncludeRemote = v.QueryOptions.IncludeRemote } return json.Marshal(&u) @@ -3078,28 +3068,22 @@ func (v *GeneralQuery) MarshalJSON() ([]byte, error) { IncludeRemote bool `json:"includeRemote,omitempty"` }{} if !(v.UrlQuery.Url == nil) { - u.Url = v.UrlQuery.Url } if !(!v.QueryOptions.Expand) { - u.Expand = v.QueryOptions.Expand u.ExpandChains = v.QueryOptions.Expand } if !(v.QueryOptions.Height == 0) { - u.Height = v.QueryOptions.Height } if !(!v.QueryOptions.Scratch) { - u.Scratch = v.QueryOptions.Scratch } if !(!v.QueryOptions.Prove) { - u.Prove = v.QueryOptions.Prove } if !(!v.QueryOptions.IncludeRemote) { - u.IncludeRemote = v.QueryOptions.IncludeRemote } return json.Marshal(&u) @@ -3114,6 +3098,7 @@ func (v *GeneralReceipt) MarshalJSON() ([]byte, error) { Proof merkle.Receipt `json:"proof,omitempty"` Receipt merkle.Receipt `json:"receipt,omitempty"` Error string `json:"error,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.LocalBlock == 0) { u.LocalBlock = v.LocalBlock @@ -3134,6 +3119,7 @@ func (v *GeneralReceipt) MarshalJSON() ([]byte, error) { if !(len(v.Error) == 0) { u.Error = v.Error } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -3155,7 +3141,6 @@ func (v *KeyPageIndexQuery) MarshalJSON() ([]byte, error) { Key *string `json:"key,omitempty"` }{} if !(v.UrlQuery.Url == nil) { - u.Url = v.UrlQuery.Url } if !(len(v.Key) == 0) { @@ -3171,15 +3156,12 @@ func (v *MajorBlocksQuery) MarshalJSON() ([]byte, error) { Count uint64 `json:"count,omitempty"` }{} if !(v.UrlQuery.Url == nil) { - u.Url = v.UrlQuery.Url } if !(v.QueryPagination.Start == 0) { - u.Start = v.QueryPagination.Start } if !(v.QueryPagination.Count == 0) { - u.Count = v.QueryPagination.Count } return json.Marshal(&u) @@ -3259,15 +3241,12 @@ func (v *MinorBlocksQuery) MarshalJSON() ([]byte, error) { BlockFilterMode BlockFilterMode `json:"blockFilterMode,omitempty"` }{} if !(v.UrlQuery.Url == nil) { - u.Url = v.UrlQuery.Url } if !(v.QueryPagination.Start == 0) { - u.Start = v.QueryPagination.Start } if !(v.QueryPagination.Count == 0) { - u.Count = v.QueryPagination.Count } if !(v.TxFetchMode == 0) { @@ -3289,11 +3268,9 @@ func (v *MinorQueryResponse) MarshalJSON() ([]byte, error) { LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` }{} if !(v.MinorBlock.BlockIndex == 0) { - u.BlockIndex = v.MinorBlock.BlockIndex } if !(v.MinorBlock.BlockTime == nil) { - u.BlockTime = v.MinorBlock.BlockTime } if !(v.TxCount == 0) { @@ -3353,6 +3330,7 @@ func (v *NetworkDescription) MarshalJSON() ([]byte, error) { Id string `json:"id,omitempty"` Partitions encoding.JsonList[PartitionDescription] `json:"partitions,omitempty"` Subnets encoding.JsonList[PartitionDescription] `json:"subnets,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Id) == 0) { u.Id = v.Id @@ -3361,15 +3339,17 @@ func (v *NetworkDescription) MarshalJSON() ([]byte, error) { u.Partitions = v.Partitions u.Subnets = v.Partitions } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *PartitionDescription) MarshalJSON() ([]byte, error) { u := struct { - Id string `json:"id,omitempty"` - Type protocol.PartitionType `json:"type,omitempty"` - BasePort int64 `json:"basePort,omitempty"` - Nodes encoding.JsonList[NodeDescription] `json:"nodes,omitempty"` + Id string `json:"id,omitempty"` + Type protocol.PartitionType `json:"type,omitempty"` + BasePort int64 `json:"basePort,omitempty"` + Nodes encoding.JsonList[NodeDescription] `json:"nodes,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Id) == 0) { u.Id = v.Id @@ -3383,6 +3363,7 @@ func (v *PartitionDescription) MarshalJSON() ([]byte, error) { if !(len(v.Nodes) == 0) { u.Nodes = v.Nodes } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -3421,6 +3402,7 @@ func (v *ResponseDataEntry) MarshalJSON() ([]byte, error) { TxId *url.TxID `json:"txId,omitempty"` CauseTxId *url.TxID `json:"causeTxId,omitempty"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.EntryHash == ([32]byte{})) { u.EntryHash = encoding.ChainToJSON(&v.EntryHash) @@ -3437,6 +3419,7 @@ func (v *ResponseDataEntry) MarshalJSON() ([]byte, error) { if !(v.LastBlockTime == nil) { u.LastBlockTime = v.LastBlockTime } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -3445,6 +3428,7 @@ func (v *ResponseDataEntrySet) MarshalJSON() ([]byte, error) { DataEntries encoding.JsonList[ResponseDataEntry] `json:"dataEntries,omitempty"` Total uint64 `json:"total,omitempty"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.DataEntries) == 0) { u.DataEntries = v.DataEntries @@ -3455,6 +3439,7 @@ func (v *ResponseDataEntrySet) MarshalJSON() ([]byte, error) { if !(v.LastBlockTime == nil) { u.LastBlockTime = v.LastBlockTime } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -3466,6 +3451,7 @@ func (v *ResponseKeyPageIndex) MarshalJSON() ([]byte, error) { KeyPage *url.URL `json:"keyPage,omitempty"` Index uint64 `json:"index"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Authority == nil) { u.Authority = v.Authority @@ -3479,6 +3465,7 @@ func (v *ResponseKeyPageIndex) MarshalJSON() ([]byte, error) { if !(v.LastBlockTime == nil) { u.LastBlockTime = v.LastBlockTime } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -3692,15 +3679,12 @@ func (v *TxHistoryQuery) MarshalJSON() ([]byte, error) { Scratch bool `json:"scratch,omitempty"` }{} if !(v.UrlQuery.Url == nil) { - u.Url = v.UrlQuery.Url } if !(v.QueryPagination.Start == 0) { - u.Start = v.QueryPagination.Start } if !(v.QueryPagination.Count == 0) { - u.Count = v.QueryPagination.Count } if !(!v.Scratch) { @@ -3720,30 +3704,25 @@ func (v *TxReceipt) MarshalJSON() ([]byte, error) { Error string `json:"error,omitempty"` Account *url.URL `json:"account,omitempty"` Chain string `json:"chain,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.GeneralReceipt.LocalBlock == 0) { - u.LocalBlock = v.GeneralReceipt.LocalBlock } if !(v.GeneralReceipt.LocalBlockTime == nil) { - u.LocalBlockTime = v.GeneralReceipt.LocalBlockTime } if !(v.GeneralReceipt.DirectoryBlock == 0) { - u.DirectoryBlock = v.GeneralReceipt.DirectoryBlock } if !(v.GeneralReceipt.MajorBlock == 0) { - u.MajorBlock = v.GeneralReceipt.MajorBlock } if !((v.GeneralReceipt.Proof).Equal(new(merkle.Receipt))) { - u.Proof = v.GeneralReceipt.Proof u.Receipt = v.GeneralReceipt.Proof } if !(len(v.GeneralReceipt.Error) == 0) { - u.Error = v.GeneralReceipt.Error } if !(v.Account == nil) { @@ -3752,6 +3731,7 @@ func (v *TxReceipt) MarshalJSON() ([]byte, error) { if !(len(v.Chain) == 0) { u.Chain = v.Chain } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -3864,24 +3844,19 @@ func (v *TxnQuery) MarshalJSON() ([]byte, error) { IgnorePending bool `json:"ignorePending,omitempty"` }{} if !(!v.QueryOptions.Expand) { - u.Expand = v.QueryOptions.Expand u.ExpandChains = v.QueryOptions.Expand } if !(v.QueryOptions.Height == 0) { - u.Height = v.QueryOptions.Height } if !(!v.QueryOptions.Scratch) { - u.Scratch = v.QueryOptions.Scratch } if !(!v.QueryOptions.Prove) { - u.Prove = v.QueryOptions.Prove } if !(!v.QueryOptions.IncludeRemote) { - u.IncludeRemote = v.QueryOptions.IncludeRemote } if !(len(v.Txid) == 0) { @@ -3913,7 +3888,8 @@ func (v *ChainEntry) UnmarshalJSON(data []byte) error { u.State[i] = encoding.BytesToJSON(x) } u.Value = encoding.AnyToJSON(v.Value) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Height = u.Height @@ -3943,7 +3919,8 @@ func (v *ChainIdQuery) UnmarshalJSON(data []byte) error { ChainId *string `json:"chainId,omitempty"` }{} u.ChainId = encoding.BytesToJSON(v.ChainId) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if x, err := encoding.BytesFromJSON(u.ChainId); err != nil { @@ -3973,7 +3950,8 @@ func (v *ChainQueryResponse) UnmarshalJSON(data []byte) error { u.ChainId = encoding.BytesToJSON(v.ChainId) u.Receipt = v.Receipt u.LastBlockTime = v.LastBlockTime - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Type = u.Type @@ -4000,11 +3978,12 @@ func (v *ChainQueryResponse) UnmarshalJSON(data []byte) error { func (v *ChainState) UnmarshalJSON(data []byte) error { u := struct { - Name string `json:"name,omitempty"` - Type protocol.ChainType `json:"type,omitempty"` - Height uint64 `json:"height,omitempty"` - Count uint64 `json:"count,omitempty"` - Roots encoding.JsonList[*string] `json:"roots,omitempty"` + Name string `json:"name,omitempty"` + Type protocol.ChainType `json:"type,omitempty"` + Height uint64 `json:"height,omitempty"` + Count uint64 `json:"count,omitempty"` + Roots encoding.JsonList[*string] `json:"roots,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Name = v.Name u.Type = v.Type @@ -4014,7 +3993,8 @@ func (v *ChainState) UnmarshalJSON(data []byte) error { for i, x := range v.Roots { u.Roots[i] = encoding.BytesToJSON(x) } - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Name = u.Name @@ -4032,6 +4012,10 @@ func (v *ChainState) UnmarshalJSON(data []byte) error { v.Roots[i] = x } } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -4039,10 +4023,12 @@ func (v *DataEntryQuery) UnmarshalJSON(data []byte) error { u := struct { Url *url.URL `json:"url,omitempty"` EntryHash *string `json:"entryHash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Url = v.Url u.EntryHash = encoding.ChainToJSON(&v.EntryHash) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Url = u.Url @@ -4051,6 +4037,10 @@ func (v *DataEntryQuery) UnmarshalJSON(data []byte) error { } else { v.EntryHash = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -4061,13 +4051,15 @@ func (v *DataEntryQueryResponse) UnmarshalJSON(data []byte) error { TxId *url.TxID `json:"txId,omitempty"` CauseTxId *url.TxID `json:"causeTxId,omitempty"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.EntryHash = encoding.ChainToJSON(&v.EntryHash) u.Entry = &encoding.JsonUnmarshalWith[protocol.DataEntry]{Value: v.Entry, Func: protocol.UnmarshalDataEntryJSON} u.TxId = v.TxId u.CauseTxId = v.CauseTxId u.LastBlockTime = v.LastBlockTime - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if x, err := encoding.ChainFromJSON(u.EntryHash); err != nil { @@ -4082,6 +4074,10 @@ func (v *DataEntryQueryResponse) UnmarshalJSON(data []byte) error { v.TxId = u.TxId v.CauseTxId = u.CauseTxId v.LastBlockTime = u.LastBlockTime + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -4106,7 +4102,8 @@ func (v *DataEntrySetQuery) UnmarshalJSON(data []byte) error { u.Scratch = v.QueryOptions.Scratch u.Prove = v.QueryOptions.Prove u.IncludeRemote = v.QueryOptions.IncludeRemote - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.UrlQuery.Url = u.Url @@ -4139,7 +4136,8 @@ func (v *DescriptionResponse) UnmarshalJSON(data []byte) error { u.NetworkAnchor = encoding.ChainToJSON(&v.NetworkAnchor) u.Values = v.Values u.Error = v.Error - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.PartitionId = u.PartitionId @@ -4176,7 +4174,8 @@ func (v *DirectoryQuery) UnmarshalJSON(data []byte) error { u.Scratch = v.QueryOptions.Scratch u.Prove = v.QueryOptions.Prove u.IncludeRemote = v.QueryOptions.IncludeRemote - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.UrlQuery.Url = u.Url @@ -4211,7 +4210,8 @@ func (v *GeneralQuery) UnmarshalJSON(data []byte) error { u.Scratch = v.QueryOptions.Scratch u.Prove = v.QueryOptions.Prove u.IncludeRemote = v.QueryOptions.IncludeRemote - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.UrlQuery.Url = u.Url @@ -4236,6 +4236,7 @@ func (v *GeneralReceipt) UnmarshalJSON(data []byte) error { Proof merkle.Receipt `json:"proof,omitempty"` Receipt merkle.Receipt `json:"receipt,omitempty"` Error string `json:"error,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.LocalBlock = v.LocalBlock u.LocalBlockTime = v.LocalBlockTime @@ -4244,7 +4245,8 @@ func (v *GeneralReceipt) UnmarshalJSON(data []byte) error { u.Proof = v.Proof u.Receipt = v.Proof u.Error = v.Error - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.LocalBlock = u.LocalBlock @@ -4257,6 +4259,10 @@ func (v *GeneralReceipt) UnmarshalJSON(data []byte) error { v.Proof = u.Receipt } v.Error = u.Error + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -4267,7 +4273,8 @@ func (v *KeyPage) UnmarshalJSON(data []byte) error { }{} u.Version = v.Version u.Height = v.Version - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(u.Version == 0) { @@ -4285,7 +4292,8 @@ func (v *KeyPageIndexQuery) UnmarshalJSON(data []byte) error { }{} u.Url = v.UrlQuery.Url u.Key = encoding.BytesToJSON(v.Key) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.UrlQuery.Url = u.Url @@ -4306,7 +4314,8 @@ func (v *MajorBlocksQuery) UnmarshalJSON(data []byte) error { u.Url = v.UrlQuery.Url u.Start = v.QueryPagination.Start u.Count = v.QueryPagination.Count - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.UrlQuery.Url = u.Url @@ -4326,7 +4335,8 @@ func (v *MajorQueryResponse) UnmarshalJSON(data []byte) error { u.MajorBlockTime = v.MajorBlockTime u.MinorBlocks = v.MinorBlocks u.LastBlockTime = v.LastBlockTime - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.MajorBlockIndex = u.MajorBlockIndex @@ -4348,7 +4358,8 @@ func (v *MerkleState) UnmarshalJSON(data []byte) error { for i, x := range v.Roots { u.Roots[i] = encoding.BytesToJSON(x) } - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(u.Height == 0) { @@ -4374,7 +4385,8 @@ func (v *MetricsQuery) UnmarshalJSON(data []byte) error { }{} u.Metric = v.Metric u.Duration = encoding.DurationToJSON(v.Duration) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Metric = u.Metric @@ -4391,7 +4403,8 @@ func (v *MetricsResponse) UnmarshalJSON(data []byte) error { Value interface{} `json:"value,omitempty"` }{} u.Value = encoding.AnyToJSON(v.Value) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if x, err := encoding.AnyFromJSON(u.Value); err != nil { @@ -4415,7 +4428,8 @@ func (v *MinorBlocksQuery) UnmarshalJSON(data []byte) error { u.Count = v.QueryPagination.Count u.TxFetchMode = v.TxFetchMode u.BlockFilterMode = v.BlockFilterMode - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.UrlQuery.Url = u.Url @@ -4444,7 +4458,8 @@ func (v *MinorQueryResponse) UnmarshalJSON(data []byte) error { } u.Transactions = v.Transactions u.LastBlockTime = v.LastBlockTime - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.MinorBlock.BlockIndex = u.BlockIndex @@ -4486,7 +4501,8 @@ func (v *MultiResponse) UnmarshalJSON(data []byte) error { u.OtherItems[i] = encoding.AnyToJSON(x) } u.LastBlockTime = v.LastBlockTime - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Type = u.Type @@ -4518,11 +4534,13 @@ func (v *NetworkDescription) UnmarshalJSON(data []byte) error { Id string `json:"id,omitempty"` Partitions encoding.JsonList[PartitionDescription] `json:"partitions,omitempty"` Subnets encoding.JsonList[PartitionDescription] `json:"subnets,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Id = v.Id u.Partitions = v.Partitions u.Subnets = v.Partitions - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Id = u.Id @@ -4531,27 +4549,37 @@ func (v *NetworkDescription) UnmarshalJSON(data []byte) error { } else { v.Partitions = u.Subnets } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *PartitionDescription) UnmarshalJSON(data []byte) error { u := struct { - Id string `json:"id,omitempty"` - Type protocol.PartitionType `json:"type,omitempty"` - BasePort int64 `json:"basePort,omitempty"` - Nodes encoding.JsonList[NodeDescription] `json:"nodes,omitempty"` + Id string `json:"id,omitempty"` + Type protocol.PartitionType `json:"type,omitempty"` + BasePort int64 `json:"basePort,omitempty"` + Nodes encoding.JsonList[NodeDescription] `json:"nodes,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Id = v.Id u.Type = v.Type u.BasePort = v.BasePort u.Nodes = v.Nodes - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Id = u.Id v.Type = u.Type v.BasePort = u.BasePort v.Nodes = u.Nodes + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -4570,7 +4598,8 @@ func (v *QueryOptions) UnmarshalJSON(data []byte) error { u.Scratch = v.Scratch u.Prove = v.Prove u.IncludeRemote = v.IncludeRemote - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(u.Expand == false) { @@ -4592,13 +4621,15 @@ func (v *ResponseDataEntry) UnmarshalJSON(data []byte) error { TxId *url.TxID `json:"txId,omitempty"` CauseTxId *url.TxID `json:"causeTxId,omitempty"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.EntryHash = encoding.ChainToJSON(&v.EntryHash) u.Entry = &encoding.JsonUnmarshalWith[protocol.DataEntry]{Value: v.Entry, Func: protocol.UnmarshalDataEntryJSON} u.TxId = v.TxId u.CauseTxId = v.CauseTxId u.LastBlockTime = v.LastBlockTime - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if x, err := encoding.ChainFromJSON(u.EntryHash); err != nil { @@ -4613,6 +4644,10 @@ func (v *ResponseDataEntry) UnmarshalJSON(data []byte) error { v.TxId = u.TxId v.CauseTxId = u.CauseTxId v.LastBlockTime = u.LastBlockTime + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -4621,16 +4656,22 @@ func (v *ResponseDataEntrySet) UnmarshalJSON(data []byte) error { DataEntries encoding.JsonList[ResponseDataEntry] `json:"dataEntries,omitempty"` Total uint64 `json:"total,omitempty"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.DataEntries = v.DataEntries u.Total = v.Total u.LastBlockTime = v.LastBlockTime - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.DataEntries = u.DataEntries v.Total = u.Total v.LastBlockTime = u.LastBlockTime + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -4642,6 +4683,7 @@ func (v *ResponseKeyPageIndex) UnmarshalJSON(data []byte) error { KeyPage *url.URL `json:"keyPage,omitempty"` Index uint64 `json:"index"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Authority = v.Authority u.KeyBook = v.Authority @@ -4649,7 +4691,8 @@ func (v *ResponseKeyPageIndex) UnmarshalJSON(data []byte) error { u.KeyPage = v.Signer u.Index = v.Index u.LastBlockTime = v.LastBlockTime - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(u.Authority == nil) { @@ -4664,6 +4707,10 @@ func (v *ResponseKeyPageIndex) UnmarshalJSON(data []byte) error { } v.Index = u.Index v.LastBlockTime = u.LastBlockTime + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -4674,7 +4721,8 @@ func (v *SignatureBook) UnmarshalJSON(data []byte) error { }{} u.Authority = v.Authority u.Pages = v.Pages - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Authority = u.Authority @@ -4689,7 +4737,8 @@ func (v *SignaturePage) UnmarshalJSON(data []byte) error { }{} u.Signer = v.Signer u.Signatures = &encoding.JsonUnmarshalListWith[protocol.Signature]{Value: v.Signatures, Func: protocol.UnmarshalSignatureJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Signer = u.Signer @@ -4719,7 +4768,8 @@ func (v *Signer) UnmarshalJSON(data []byte) error { u.Version = v.Version u.SignatureType = v.SignatureType u.UseSimpleHash = v.UseSimpleHash - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if x, err := encoding.BytesFromJSON(u.PublicKey); err != nil { @@ -4762,7 +4812,8 @@ func (v *StatusResponse) UnmarshalJSON(data []byte) error { u.DnRootHash = encoding.ChainToJSON(&v.DnRootHash) u.BvnBptHash = encoding.ChainToJSON(&v.BvnBptHash) u.DnBptHash = encoding.ChainToJSON(&v.DnBptHash) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Ok = u.Ok @@ -4803,7 +4854,8 @@ func (v *TokenDeposit) UnmarshalJSON(data []byte) error { u.Url = v.Url u.Amount = encoding.BigintToJSON(&v.Amount) u.Txid = encoding.BytesToJSON(v.Txid) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Url = u.Url @@ -4827,7 +4879,8 @@ func (v *TokenSend) UnmarshalJSON(data []byte) error { }{} u.From = v.From u.To = v.To - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.From = u.From @@ -4870,7 +4923,8 @@ func (v *TransactionQueryResponse) UnmarshalJSON(data []byte) error { u.Receipts = v.Receipts u.SignatureBooks = v.SignatureBooks u.LastBlockTime = v.LastBlockTime - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Type = u.Type @@ -4925,7 +4979,8 @@ func (v *TxHistoryQuery) UnmarshalJSON(data []byte) error { u.Start = v.QueryPagination.Start u.Count = v.QueryPagination.Count u.Scratch = v.Scratch - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.UrlQuery.Url = u.Url @@ -4946,6 +5001,7 @@ func (v *TxReceipt) UnmarshalJSON(data []byte) error { Error string `json:"error,omitempty"` Account *url.URL `json:"account,omitempty"` Chain string `json:"chain,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.LocalBlock = v.GeneralReceipt.LocalBlock u.LocalBlockTime = v.GeneralReceipt.LocalBlockTime @@ -4956,7 +5012,8 @@ func (v *TxReceipt) UnmarshalJSON(data []byte) error { u.Error = v.GeneralReceipt.Error u.Account = v.Account u.Chain = v.Chain - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.GeneralReceipt.LocalBlock = u.LocalBlock @@ -4971,6 +5028,10 @@ func (v *TxReceipt) UnmarshalJSON(data []byte) error { v.GeneralReceipt.Error = u.Error v.Account = u.Account v.Chain = u.Chain + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -4999,7 +5060,8 @@ func (v *TxRequest) UnmarshalJSON(data []byte) error { u.Payload = encoding.AnyToJSON(v.Payload) u.Memo = v.Memo u.Metadata = encoding.BytesToJSON(v.Metadata) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.CheckOnly = u.CheckOnly @@ -5061,7 +5123,8 @@ func (v *TxResponse) UnmarshalJSON(data []byte) error { u.Delivered = v.Delivered u.Result = encoding.AnyToJSON(v.Result) u.LastBlockTime = v.LastBlockTime - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if x, err := encoding.BytesFromJSON(u.TransactionHash); err != nil { @@ -5126,7 +5189,8 @@ func (v *TxnQuery) UnmarshalJSON(data []byte) error { u.TxIdUrl = v.TxIdUrl u.Wait = encoding.DurationToJSON(v.Wait) u.IgnorePending = v.IgnorePending - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(u.Expand == false) { diff --git a/internal/core/healing/types_gen.go b/internal/core/healing/types_gen.go index 063e8a5d0..4d3e67d64 100644 --- a/internal/core/healing/types_gen.go +++ b/internal/core/healing/types_gen.go @@ -112,11 +112,13 @@ func (v *PeerInfo) UnmarshalJSON(data []byte) error { Status *api.ConsensusStatus `json:"status,omitempty"` Addresses *encoding.JsonUnmarshalListWith[p2p.Multiaddr] `json:"addresses,omitempty"` }{} + u.Operator = v.Operator u.Key = encoding.ChainToJSON(&v.Key) u.Status = v.Status u.Addresses = &encoding.JsonUnmarshalListWith[p2p.Multiaddr]{Value: v.Addresses, Func: p2p.UnmarshalMultiaddrJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Operator = u.Operator diff --git a/internal/database/snapshot/types_gen.go b/internal/database/snapshot/types_gen.go index 676079a92..0d2c5c56c 100644 --- a/internal/database/snapshot/types_gen.go +++ b/internal/database/snapshot/types_gen.go @@ -1534,6 +1534,7 @@ func (v *Account) MarshalJSON() ([]byte, error) { Directory encoding.JsonList[*url.URL] `json:"directory,omitempty"` Url *url.URL `json:"url,omitempty"` Chains encoding.JsonList[*Chain] `json:"chains,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(protocol.EqualAccount(v.Main, nil)) { u.Main = &encoding.JsonUnmarshalWith[protocol.Account]{Value: v.Main, Func: protocol.UnmarshalAccountJSON} @@ -1553,6 +1554,7 @@ func (v *Account) MarshalJSON() ([]byte, error) { if !(len(v.Chains) == 0) { u.Chains = v.Chains } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -1563,6 +1565,7 @@ func (v *Chain) MarshalJSON() ([]byte, error) { MarkPower uint64 `json:"markPower,omitempty"` Head *merkle.State `json:"head,omitempty"` MarkPoints encoding.JsonList[*merkle.State] `json:"markPoints,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Name) == 0) { u.Name = v.Name @@ -1579,6 +1582,7 @@ func (v *Chain) MarshalJSON() ([]byte, error) { if !(len(v.MarkPoints) == 0) { u.MarkPoints = v.MarkPoints } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -1590,6 +1594,7 @@ func (v *Header) MarshalJSON() ([]byte, error) { Timestamp time.Time `json:"timestamp,omitempty"` ExecutorVersion protocol.ExecutorVersion `json:"executorVersion,omitempty"` PartitionSnapshotIDs encoding.JsonList[string] `json:"partitionSnapshotIDs,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Version == 0) { u.Version = v.Version @@ -1609,16 +1614,18 @@ func (v *Header) MarshalJSON() ([]byte, error) { if !(len(v.PartitionSnapshotIDs) == 0) { u.PartitionSnapshotIDs = v.PartitionSnapshotIDs } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *OldChain) MarshalJSON() ([]byte, error) { u := struct { - Name string `json:"name,omitempty"` - Type protocol.ChainType `json:"type,omitempty"` - Count uint64 `json:"count,omitempty"` - Pending encoding.JsonList[*string] `json:"pending,omitempty"` - Entries encoding.JsonList[*string] `json:"entries,omitempty"` + Name string `json:"name,omitempty"` + Type protocol.ChainType `json:"type,omitempty"` + Count uint64 `json:"count,omitempty"` + Pending encoding.JsonList[*string] `json:"pending,omitempty"` + Entries encoding.JsonList[*string] `json:"entries,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Name) == 0) { u.Name = v.Name @@ -1641,6 +1648,7 @@ func (v *OldChain) MarshalJSON() ([]byte, error) { u.Entries[i] = encoding.BytesToJSON(x) } } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -1648,6 +1656,7 @@ func (v *Signature) MarshalJSON() ([]byte, error) { u := struct { Txid *url.TxID `json:"txid,omitempty"` Signature *encoding.JsonUnmarshalWith[protocol.Signature] `json:"signature,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Txid == nil) { u.Txid = v.Txid @@ -1655,6 +1664,7 @@ func (v *Signature) MarshalJSON() ([]byte, error) { if !(protocol.EqualSignature(v.Signature, nil)) { u.Signature = &encoding.JsonUnmarshalWith[protocol.Signature]{Value: v.Signature, Func: protocol.UnmarshalSignatureJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -1663,6 +1673,7 @@ func (v *Transaction) MarshalJSON() ([]byte, error) { Transaction *protocol.Transaction `json:"transaction,omitempty"` Status *protocol.TransactionStatus `json:"status,omitempty"` SignatureSets encoding.JsonList[*TxnSigSet] `json:"signatureSets,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Transaction == nil) { u.Transaction = v.Transaction @@ -1673,14 +1684,16 @@ func (v *Transaction) MarshalJSON() ([]byte, error) { if !(len(v.SignatureSets) == 0) { u.SignatureSets = v.SignatureSets } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *TxnSigSet) MarshalJSON() ([]byte, error) { u := struct { - Signer *url.URL `json:"signer,omitempty"` - Version uint64 `json:"version,omitempty"` - Entries encoding.JsonList[database.SigSetEntry] `json:"entries,omitempty"` + Signer *url.URL `json:"signer,omitempty"` + Version uint64 `json:"version,omitempty"` + Entries encoding.JsonList[database.SigSetEntry] `json:"entries,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Signer == nil) { u.Signer = v.Signer @@ -1691,26 +1704,31 @@ func (v *TxnSigSet) MarshalJSON() ([]byte, error) { if !(len(v.Entries) == 0) { u.Entries = v.Entries } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *sigSection) MarshalJSON() ([]byte, error) { u := struct { Signatures encoding.JsonList[*Signature] `json:"signatures,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Signatures) == 0) { u.Signatures = v.Signatures } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *txnSection) MarshalJSON() ([]byte, error) { u := struct { Transactions encoding.JsonList[*Transaction] `json:"transactions,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Transactions) == 0) { u.Transactions = v.Transactions } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -1722,14 +1740,17 @@ func (v *Account) UnmarshalJSON(data []byte) error { Directory encoding.JsonList[*url.URL] `json:"directory,omitempty"` Url *url.URL `json:"url,omitempty"` Chains encoding.JsonList[*Chain] `json:"chains,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} + u.Main = &encoding.JsonUnmarshalWith[protocol.Account]{Value: v.Main, Func: protocol.UnmarshalAccountJSON} u.OldChains = v.OldChains u.Pending = v.Pending u.Directory = v.Directory u.Url = v.Url u.Chains = v.Chains - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if u.Main != nil { @@ -1741,6 +1762,10 @@ func (v *Account) UnmarshalJSON(data []byte) error { v.Directory = u.Directory v.Url = u.Url v.Chains = u.Chains + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -1751,13 +1776,15 @@ func (v *Chain) UnmarshalJSON(data []byte) error { MarkPower uint64 `json:"markPower,omitempty"` Head *merkle.State `json:"head,omitempty"` MarkPoints encoding.JsonList[*merkle.State] `json:"markPoints,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Name = v.Name u.Type = v.Type u.MarkPower = v.MarkPower u.Head = v.Head u.MarkPoints = v.MarkPoints - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Name = u.Name @@ -1765,6 +1792,10 @@ func (v *Chain) UnmarshalJSON(data []byte) error { v.MarkPower = u.MarkPower v.Head = u.Head v.MarkPoints = u.MarkPoints + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -1776,6 +1807,7 @@ func (v *Header) UnmarshalJSON(data []byte) error { Timestamp time.Time `json:"timestamp,omitempty"` ExecutorVersion protocol.ExecutorVersion `json:"executorVersion,omitempty"` PartitionSnapshotIDs encoding.JsonList[string] `json:"partitionSnapshotIDs,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Version = v.Version u.Height = v.Height @@ -1783,7 +1815,8 @@ func (v *Header) UnmarshalJSON(data []byte) error { u.Timestamp = v.Timestamp u.ExecutorVersion = v.ExecutorVersion u.PartitionSnapshotIDs = v.PartitionSnapshotIDs - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Version = u.Version @@ -1796,16 +1829,21 @@ func (v *Header) UnmarshalJSON(data []byte) error { v.Timestamp = u.Timestamp v.ExecutorVersion = u.ExecutorVersion v.PartitionSnapshotIDs = u.PartitionSnapshotIDs + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *OldChain) UnmarshalJSON(data []byte) error { u := struct { - Name string `json:"name,omitempty"` - Type protocol.ChainType `json:"type,omitempty"` - Count uint64 `json:"count,omitempty"` - Pending encoding.JsonList[*string] `json:"pending,omitempty"` - Entries encoding.JsonList[*string] `json:"entries,omitempty"` + Name string `json:"name,omitempty"` + Type protocol.ChainType `json:"type,omitempty"` + Count uint64 `json:"count,omitempty"` + Pending encoding.JsonList[*string] `json:"pending,omitempty"` + Entries encoding.JsonList[*string] `json:"entries,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Name = v.Name u.Type = v.Type @@ -1818,7 +1856,8 @@ func (v *OldChain) UnmarshalJSON(data []byte) error { for i, x := range v.Entries { u.Entries[i] = encoding.BytesToJSON(x) } - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Name = u.Name @@ -1840,6 +1879,10 @@ func (v *OldChain) UnmarshalJSON(data []byte) error { v.Entries[i] = x } } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -1847,10 +1890,12 @@ func (v *Signature) UnmarshalJSON(data []byte) error { u := struct { Txid *url.TxID `json:"txid,omitempty"` Signature *encoding.JsonUnmarshalWith[protocol.Signature] `json:"signature,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Txid = v.Txid u.Signature = &encoding.JsonUnmarshalWith[protocol.Signature]{Value: v.Signature, Func: protocol.UnmarshalSignatureJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Txid = u.Txid @@ -1858,6 +1903,10 @@ func (v *Signature) UnmarshalJSON(data []byte) error { v.Signature = u.Signature.Value } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -1866,57 +1915,81 @@ func (v *Transaction) UnmarshalJSON(data []byte) error { Transaction *protocol.Transaction `json:"transaction,omitempty"` Status *protocol.TransactionStatus `json:"status,omitempty"` SignatureSets encoding.JsonList[*TxnSigSet] `json:"signatureSets,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Transaction = v.Transaction u.Status = v.Status u.SignatureSets = v.SignatureSets - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Transaction = u.Transaction v.Status = u.Status v.SignatureSets = u.SignatureSets + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *TxnSigSet) UnmarshalJSON(data []byte) error { u := struct { - Signer *url.URL `json:"signer,omitempty"` - Version uint64 `json:"version,omitempty"` - Entries encoding.JsonList[database.SigSetEntry] `json:"entries,omitempty"` + Signer *url.URL `json:"signer,omitempty"` + Version uint64 `json:"version,omitempty"` + Entries encoding.JsonList[database.SigSetEntry] `json:"entries,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Signer = v.Signer u.Version = v.Version u.Entries = v.Entries - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Signer = u.Signer v.Version = u.Version v.Entries = u.Entries + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *sigSection) UnmarshalJSON(data []byte) error { u := struct { Signatures encoding.JsonList[*Signature] `json:"signatures,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Signatures = v.Signatures - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Signatures = u.Signatures + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *txnSection) UnmarshalJSON(data []byte) error { u := struct { Transactions encoding.JsonList[*Transaction] `json:"transactions,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Transactions = v.Transactions - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Transactions = u.Transactions + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } diff --git a/internal/database/types_gen.go b/internal/database/types_gen.go index 59d830048..25b198e55 100644 --- a/internal/database/types_gen.go +++ b/internal/database/types_gen.go @@ -1027,6 +1027,7 @@ func (v *BlockStateSynthTxnEntry) MarshalJSON() ([]byte, error) { Account *url.URL `json:"account,omitempty"` Transaction *string `json:"transaction,omitempty"` ChainEntry uint64 `json:"chainEntry,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Account == nil) { u.Account = v.Account @@ -1037,6 +1038,7 @@ func (v *BlockStateSynthTxnEntry) MarshalJSON() ([]byte, error) { if !(v.ChainEntry == 0) { u.ChainEntry = v.ChainEntry } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -1045,6 +1047,7 @@ func (v *SigOrTxn) MarshalJSON() ([]byte, error) { Transaction *protocol.Transaction `json:"transaction,omitempty"` Signature *encoding.JsonUnmarshalWith[protocol.Signature] `json:"signature,omitempty"` Txid *url.TxID `json:"txid,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Transaction == nil) { u.Transaction = v.Transaction @@ -1055,6 +1058,7 @@ func (v *SigOrTxn) MarshalJSON() ([]byte, error) { if !(v.Txid == nil) { u.Txid = v.Txid } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -1064,6 +1068,7 @@ func (v *SigSetEntry) MarshalJSON() ([]byte, error) { KeyEntryIndex uint64 `json:"keyEntryIndex,omitempty"` SignatureHash *string `json:"signatureHash,omitempty"` ValidatorKeyHash *string `json:"validatorKeyHash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Type == 0) { u.Type = v.Type @@ -1077,15 +1082,17 @@ func (v *SigSetEntry) MarshalJSON() ([]byte, error) { if !(v.ValidatorKeyHash == nil) { u.ValidatorKeyHash = encoding.ChainToJSON(v.ValidatorKeyHash) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *SignatureSetEntry) MarshalJSON() ([]byte, error) { u := struct { - KeyIndex uint64 `json:"keyIndex"` - Version uint64 `json:"version,omitempty"` - Path encoding.JsonList[*url.URL] `json:"path,omitempty"` - Hash *string `json:"hash,omitempty"` + KeyIndex uint64 `json:"keyIndex"` + Version uint64 `json:"version,omitempty"` + Path encoding.JsonList[*url.URL] `json:"path,omitempty"` + Hash *string `json:"hash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.KeyIndex = v.KeyIndex if !(v.Version == 0) { @@ -1097,6 +1104,7 @@ func (v *SignatureSetEntry) MarshalJSON() ([]byte, error) { if !(v.Hash == ([32]byte{})) { u.Hash = encoding.ChainToJSON(&v.Hash) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -1104,6 +1112,7 @@ func (v *VoteEntry) MarshalJSON() ([]byte, error) { u := struct { Authority *url.URL `json:"authority,omitempty"` Hash *string `json:"hash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Authority == nil) { u.Authority = v.Authority @@ -1111,13 +1120,15 @@ func (v *VoteEntry) MarshalJSON() ([]byte, error) { if !(v.Hash == ([32]byte{})) { u.Hash = encoding.ChainToJSON(&v.Hash) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *sigSetData) MarshalJSON() ([]byte, error) { u := struct { - Version uint64 `json:"version,omitempty"` - Entries encoding.JsonList[SigSetEntry] `json:"entries,omitempty"` + Version uint64 `json:"version,omitempty"` + Entries encoding.JsonList[SigSetEntry] `json:"entries,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Version == 0) { u.Version = v.Version @@ -1125,6 +1136,7 @@ func (v *sigSetData) MarshalJSON() ([]byte, error) { if !(len(v.Entries) == 0) { u.Entries = v.Entries } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -1133,11 +1145,13 @@ func (v *BlockStateSynthTxnEntry) UnmarshalJSON(data []byte) error { Account *url.URL `json:"account,omitempty"` Transaction *string `json:"transaction,omitempty"` ChainEntry uint64 `json:"chainEntry,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Account = v.Account u.Transaction = encoding.BytesToJSON(v.Transaction) u.ChainEntry = v.ChainEntry - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Account = u.Account @@ -1147,6 +1161,10 @@ func (v *BlockStateSynthTxnEntry) UnmarshalJSON(data []byte) error { v.Transaction = x } v.ChainEntry = u.ChainEntry + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -1155,11 +1173,13 @@ func (v *SigOrTxn) UnmarshalJSON(data []byte) error { Transaction *protocol.Transaction `json:"transaction,omitempty"` Signature *encoding.JsonUnmarshalWith[protocol.Signature] `json:"signature,omitempty"` Txid *url.TxID `json:"txid,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Transaction = v.Transaction u.Signature = &encoding.JsonUnmarshalWith[protocol.Signature]{Value: v.Signature, Func: protocol.UnmarshalSignatureJSON} u.Txid = v.Txid - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Transaction = u.Transaction @@ -1168,6 +1188,10 @@ func (v *SigOrTxn) UnmarshalJSON(data []byte) error { } v.Txid = u.Txid + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -1177,12 +1201,14 @@ func (v *SigSetEntry) UnmarshalJSON(data []byte) error { KeyEntryIndex uint64 `json:"keyEntryIndex,omitempty"` SignatureHash *string `json:"signatureHash,omitempty"` ValidatorKeyHash *string `json:"validatorKeyHash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type u.KeyEntryIndex = v.KeyEntryIndex u.SignatureHash = encoding.ChainToJSON(&v.SignatureHash) u.ValidatorKeyHash = encoding.ChainToJSON(v.ValidatorKeyHash) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Type = u.Type @@ -1199,21 +1225,27 @@ func (v *SigSetEntry) UnmarshalJSON(data []byte) error { v.ValidatorKeyHash = x } } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *SignatureSetEntry) UnmarshalJSON(data []byte) error { u := struct { - KeyIndex uint64 `json:"keyIndex"` - Version uint64 `json:"version,omitempty"` - Path encoding.JsonList[*url.URL] `json:"path,omitempty"` - Hash *string `json:"hash,omitempty"` + KeyIndex uint64 `json:"keyIndex"` + Version uint64 `json:"version,omitempty"` + Path encoding.JsonList[*url.URL] `json:"path,omitempty"` + Hash *string `json:"hash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.KeyIndex = v.KeyIndex u.Version = v.Version u.Path = v.Path u.Hash = encoding.ChainToJSON(&v.Hash) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.KeyIndex = u.KeyIndex @@ -1224,6 +1256,10 @@ func (v *SignatureSetEntry) UnmarshalJSON(data []byte) error { } else { v.Hash = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -1231,10 +1267,12 @@ func (v *VoteEntry) UnmarshalJSON(data []byte) error { u := struct { Authority *url.URL `json:"authority,omitempty"` Hash *string `json:"hash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Authority = v.Authority u.Hash = encoding.ChainToJSON(&v.Hash) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Authority = u.Authority @@ -1243,20 +1281,30 @@ func (v *VoteEntry) UnmarshalJSON(data []byte) error { } else { v.Hash = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *sigSetData) UnmarshalJSON(data []byte) error { u := struct { - Version uint64 `json:"version,omitempty"` - Entries encoding.JsonList[SigSetEntry] `json:"entries,omitempty"` + Version uint64 `json:"version,omitempty"` + Entries encoding.JsonList[SigSetEntry] `json:"entries,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Version = v.Version u.Entries = v.Entries - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Version = u.Version v.Entries = u.Entries + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } diff --git a/internal/node/config/types_gen.go b/internal/node/config/types_gen.go index 572d51911..f1d04b6f3 100644 --- a/internal/node/config/types_gen.go +++ b/internal/node/config/types_gen.go @@ -676,6 +676,7 @@ func (v *Describe) MarshalJSON() ([]byte, error) { PartitionId string `json:"partitionId,omitempty"` SubnetId string `json:"subnetId,omitempty"` Network Network `json:"network,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.NetworkType == 0) { u.NetworkType = v.NetworkType @@ -687,6 +688,7 @@ func (v *Describe) MarshalJSON() ([]byte, error) { if !((v.Network).Equal(new(Network))) { u.Network = v.Network } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -694,6 +696,7 @@ func (v *P2P) MarshalJSON() ([]byte, error) { u := struct { Listen *encoding.JsonUnmarshalListWith[p2p.Multiaddr] `json:"listen,omitempty"` BootstrapPeers *encoding.JsonUnmarshalListWith[p2p.Multiaddr] `json:"bootstrapPeers,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Listen) == 0) { u.Listen = &encoding.JsonUnmarshalListWith[p2p.Multiaddr]{Value: v.Listen, Func: p2p.UnmarshalMultiaddrJSON} @@ -701,15 +704,17 @@ func (v *P2P) MarshalJSON() ([]byte, error) { if !(len(v.BootstrapPeers) == 0) { u.BootstrapPeers = &encoding.JsonUnmarshalListWith[p2p.Multiaddr]{Value: v.BootstrapPeers, Func: p2p.UnmarshalMultiaddrJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *Partition) MarshalJSON() ([]byte, error) { u := struct { - Id string `json:"id,omitempty"` - Type protocol.PartitionType `json:"type,omitempty"` - BasePort int64 `json:"basePort,omitempty"` - Nodes encoding.JsonList[Node] `json:"nodes,omitempty"` + Id string `json:"id,omitempty"` + Type protocol.PartitionType `json:"type,omitempty"` + BasePort int64 `json:"basePort,omitempty"` + Nodes encoding.JsonList[Node] `json:"nodes,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Id) == 0) { u.Id = v.Id @@ -723,6 +728,7 @@ func (v *Partition) MarshalJSON() ([]byte, error) { if !(len(v.Nodes) == 0) { u.Nodes = v.Nodes } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -732,12 +738,14 @@ func (v *Describe) UnmarshalJSON(data []byte) error { PartitionId string `json:"partitionId,omitempty"` SubnetId string `json:"subnetId,omitempty"` Network Network `json:"network,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.NetworkType = v.NetworkType u.PartitionId = v.PartitionId u.SubnetId = v.PartitionId u.Network = v.Network - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.NetworkType = u.NetworkType @@ -747,6 +755,10 @@ func (v *Describe) UnmarshalJSON(data []byte) error { v.PartitionId = u.SubnetId } v.Network = u.Network + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -754,10 +766,12 @@ func (v *P2P) UnmarshalJSON(data []byte) error { u := struct { Listen *encoding.JsonUnmarshalListWith[p2p.Multiaddr] `json:"listen,omitempty"` BootstrapPeers *encoding.JsonUnmarshalListWith[p2p.Multiaddr] `json:"bootstrapPeers,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Listen = &encoding.JsonUnmarshalListWith[p2p.Multiaddr]{Value: v.Listen, Func: p2p.UnmarshalMultiaddrJSON} u.BootstrapPeers = &encoding.JsonUnmarshalListWith[p2p.Multiaddr]{Value: v.BootstrapPeers, Func: p2p.UnmarshalMultiaddrJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if u.Listen != nil { @@ -772,26 +786,36 @@ func (v *P2P) UnmarshalJSON(data []byte) error { v.BootstrapPeers[i] = x } } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *Partition) UnmarshalJSON(data []byte) error { u := struct { - Id string `json:"id,omitempty"` - Type protocol.PartitionType `json:"type,omitempty"` - BasePort int64 `json:"basePort,omitempty"` - Nodes encoding.JsonList[Node] `json:"nodes,omitempty"` + Id string `json:"id,omitempty"` + Type protocol.PartitionType `json:"type,omitempty"` + BasePort int64 `json:"basePort,omitempty"` + Nodes encoding.JsonList[Node] `json:"nodes,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Id = v.Id u.Type = v.Type u.BasePort = v.BasePort u.Nodes = v.Nodes - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Id = u.Id v.Type = u.Type v.BasePort = u.BasePort v.Nodes = u.Nodes + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } diff --git a/internal/node/daemon/types_gen.go b/internal/node/daemon/types_gen.go index d88807942..87d7cca50 100644 --- a/internal/node/daemon/types_gen.go +++ b/internal/node/daemon/types_gen.go @@ -355,6 +355,7 @@ func (v *NodeInit) MarshalJSON() ([]byte, error) { DnNodeKey *string `json:"dnNodeKey,omitempty"` BvnNodeKey *string `json:"bvnNodeKey,omitempty"` BsnNodeKey *string `json:"bsnNodeKey,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.DnnType == 0) { u.DnnType = v.DnnType @@ -391,6 +392,7 @@ func (v *NodeInit) MarshalJSON() ([]byte, error) { if !(len(v.BsnNodeKey) == 0) { u.BsnNodeKey = encoding.BytesToJSON(v.BsnNodeKey) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -401,7 +403,8 @@ func (v *BvnInit) UnmarshalJSON(data []byte) error { }{} u.Id = v.Id u.Nodes = v.Nodes - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Id = u.Id @@ -422,7 +425,8 @@ func (v *NetworkInit) UnmarshalJSON(data []byte) error { u.Bootstrap = v.Bootstrap u.Bvns = v.Bvns u.Bsn = v.Bsn - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Id = u.Id @@ -448,6 +452,7 @@ func (v *NodeInit) UnmarshalJSON(data []byte) error { DnNodeKey *string `json:"dnNodeKey,omitempty"` BvnNodeKey *string `json:"bvnNodeKey,omitempty"` BsnNodeKey *string `json:"bsnNodeKey,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.DnnType = v.DnnType u.BvnnType = v.BvnnType @@ -462,7 +467,8 @@ func (v *NodeInit) UnmarshalJSON(data []byte) error { u.DnNodeKey = encoding.BytesToJSON(v.DnNodeKey) u.BvnNodeKey = encoding.BytesToJSON(v.BvnNodeKey) u.BsnNodeKey = encoding.BytesToJSON(v.BsnNodeKey) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.DnnType = u.DnnType @@ -500,5 +506,9 @@ func (v *NodeInit) UnmarshalJSON(data []byte) error { } else { v.BsnNodeKey = x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } diff --git a/pkg/api/v3/message/types_gen.go b/pkg/api/v3/message/types_gen.go index 4c083cfdc..74a23f680 100644 --- a/pkg/api/v3/message/types_gen.go +++ b/pkg/api/v3/message/types_gen.go @@ -3080,9 +3080,10 @@ func (v *ValidateResponse) UnmarshalFieldsFrom(reader *encoding.Reader) error { func (v *Addressed) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Message *encoding.JsonUnmarshalWith[Message] `json:"message,omitempty"` - Address *encoding.JsonUnmarshalWith[p2p.Multiaddr] `json:"address,omitempty"` + Type Type `json:"type"` + Message *encoding.JsonUnmarshalWith[Message] `json:"message,omitempty"` + Address *encoding.JsonUnmarshalWith[p2p.Multiaddr] `json:"address,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(Equal(v.Message, nil)) { @@ -3091,215 +3092,231 @@ func (v *Addressed) MarshalJSON() ([]byte, error) { if !(p2p.EqualMultiaddr(v.Address, nil)) { u.Address = &encoding.JsonUnmarshalWith[p2p.Multiaddr]{Value: v.Address, Func: p2p.UnmarshalMultiaddrJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *ConsensusStatusRequest) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - NodeID string `json:"nodeID,omitempty"` - Partition string `json:"partition,omitempty"` - IncludePeers *bool `json:"includePeers,omitempty"` - IncludeAccumulate *bool `json:"includeAccumulate,omitempty"` + Type Type `json:"type"` + NodeID string `json:"nodeID,omitempty"` + Partition string `json:"partition,omitempty"` + IncludePeers *bool `json:"includePeers,omitempty"` + IncludeAccumulate *bool `json:"includeAccumulate,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.ConsensusStatusOptions.NodeID) == 0) { - u.NodeID = v.ConsensusStatusOptions.NodeID } if !(len(v.ConsensusStatusOptions.Partition) == 0) { - u.Partition = v.ConsensusStatusOptions.Partition } if !(v.ConsensusStatusOptions.IncludePeers == nil) { - u.IncludePeers = v.ConsensusStatusOptions.IncludePeers } if !(v.ConsensusStatusOptions.IncludeAccumulate == nil) { - u.IncludeAccumulate = v.ConsensusStatusOptions.IncludeAccumulate } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *ConsensusStatusResponse) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Value *api.ConsensusStatus `json:"value,omitempty"` + Type Type `json:"type"` + Value *api.ConsensusStatus `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Value == nil) { u.Value = v.Value } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *ErrorResponse) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Error *errors2.Error `json:"error,omitempty"` + Type Type `json:"type"` + Error *errors2.Error `json:"error,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Error == nil) { u.Error = v.Error } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *EventMessage) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Value *encoding.JsonUnmarshalListWith[api.Event] `json:"value"` + Type Type `json:"type"` + Value *encoding.JsonUnmarshalListWith[api.Event] `json:"value"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Value = &encoding.JsonUnmarshalListWith[api.Event]{Value: v.Value, Func: api.UnmarshalEventJSON} + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *FaucetRequest) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Account *url.URL `json:"account,omitempty"` - Token *url.URL `json:"token,omitempty"` + Type Type `json:"type"` + Account *url.URL `json:"account,omitempty"` + Token *url.URL `json:"token,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Account == nil) { u.Account = v.Account } if !(v.FaucetOptions.Token == nil) { - u.Token = v.FaucetOptions.Token } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *FaucetResponse) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Value *api.Submission `json:"value,omitempty"` + Type Type `json:"type"` + Value *api.Submission `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Value == nil) { u.Value = v.Value } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *FindServiceRequest) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Network string `json:"network,omitempty"` - Service *api.ServiceAddress `json:"service,omitempty"` - Known bool `json:"known,omitempty"` - Timeout interface{} `json:"timeout,omitempty"` + Type Type `json:"type"` + Network string `json:"network,omitempty"` + Service *api.ServiceAddress `json:"service,omitempty"` + Known bool `json:"known,omitempty"` + Timeout interface{} `json:"timeout,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.FindServiceOptions.Network) == 0) { - u.Network = v.FindServiceOptions.Network } if !(v.FindServiceOptions.Service == nil) { - u.Service = v.FindServiceOptions.Service } if !(!v.FindServiceOptions.Known) { - u.Known = v.FindServiceOptions.Known } if !(v.FindServiceOptions.Timeout == 0) { - u.Timeout = encoding.DurationToJSON(v.FindServiceOptions.Timeout) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *FindServiceResponse) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Value encoding.JsonList[*api.FindServiceResult] `json:"value"` + Type Type `json:"type"` + Value encoding.JsonList[*api.FindServiceResult] `json:"value"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Value = v.Value + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *MetricsRequest) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Partition string `json:"partition,omitempty"` - Span uint64 `json:"span,omitempty"` + Type Type `json:"type"` + Partition string `json:"partition,omitempty"` + Span uint64 `json:"span,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.MetricsOptions.Partition) == 0) { - u.Partition = v.MetricsOptions.Partition } if !(v.MetricsOptions.Span == 0) { - u.Span = v.MetricsOptions.Span } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *MetricsResponse) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Value *api.Metrics `json:"value,omitempty"` + Type Type `json:"type"` + Value *api.Metrics `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Value == nil) { u.Value = v.Value } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *NetworkStatusRequest) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Partition string `json:"partition,omitempty"` + Type Type `json:"type"` + Partition string `json:"partition,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.NetworkStatusOptions.Partition) == 0) { - u.Partition = v.NetworkStatusOptions.Partition } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *NetworkStatusResponse) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Value *api.NetworkStatus `json:"value,omitempty"` + Type Type `json:"type"` + Value *api.NetworkStatus `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Value == nil) { u.Value = v.Value } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *NodeInfoRequest) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - PeerID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"peerID,omitempty"` + Type Type `json:"type"` + PeerID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"peerID,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.NodeInfoOptions.PeerID == ("")) { - u.PeerID = &encoding.JsonUnmarshalWith[p2p.PeerID]{Value: v.NodeInfoOptions.PeerID, Func: p2p.UnmarshalPeerIDJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *NodeInfoResponse) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Value *api.NodeInfo `json:"value,omitempty"` + Type Type `json:"type"` + Value *api.NodeInfo `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Value == nil) { u.Value = v.Value } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -3310,6 +3327,7 @@ func (v *PrivateSequenceRequest) MarshalJSON() ([]byte, error) { Destination *url.URL `json:"destination,omitempty"` SequenceNumber uint64 `json:"sequenceNumber,omitempty"` NodeID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"nodeID,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Source == nil) { @@ -3322,29 +3340,32 @@ func (v *PrivateSequenceRequest) MarshalJSON() ([]byte, error) { u.SequenceNumber = v.SequenceNumber } if !(v.SequenceOptions.NodeID == ("")) { - u.NodeID = &encoding.JsonUnmarshalWith[p2p.PeerID]{Value: v.SequenceOptions.NodeID, Func: p2p.UnmarshalPeerIDJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *PrivateSequenceResponse) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Value *api.MessageRecord[messaging.Message] `json:"value,omitempty"` + Type Type `json:"type"` + Value *api.MessageRecord[messaging.Message] `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Value == nil) { u.Value = v.Value } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *QueryRequest) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Scope *url.URL `json:"scope,omitempty"` - Query *encoding.JsonUnmarshalWith[api.Query] `json:"query,omitempty"` + Type Type `json:"type"` + Scope *url.URL `json:"scope,omitempty"` + Query *encoding.JsonUnmarshalWith[api.Query] `json:"query,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Scope == nil) { @@ -3353,50 +3374,55 @@ func (v *QueryRequest) MarshalJSON() ([]byte, error) { if !(api.EqualQuery(v.Query, nil)) { u.Query = &encoding.JsonUnmarshalWith[api.Query]{Value: v.Query, Func: api.UnmarshalQueryJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *RecordResponse) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Value *encoding.JsonUnmarshalWith[api.Record] `json:"value,omitempty"` + Type Type `json:"type"` + Value *encoding.JsonUnmarshalWith[api.Record] `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(api.EqualRecord(v.Value, nil)) { u.Value = &encoding.JsonUnmarshalWith[api.Record]{Value: v.Value, Func: api.UnmarshalRecordJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *SubmitRequest) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Envelope *messaging.Envelope `json:"envelope,omitempty"` - Verify *bool `json:"verify,omitempty"` - Wait *bool `json:"wait,omitempty"` + Type Type `json:"type"` + Envelope *messaging.Envelope `json:"envelope,omitempty"` + Verify *bool `json:"verify,omitempty"` + Wait *bool `json:"wait,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Envelope == nil) { u.Envelope = v.Envelope } if !(v.SubmitOptions.Verify == nil) { - u.Verify = v.SubmitOptions.Verify } if !(v.SubmitOptions.Wait == nil) { - u.Wait = v.SubmitOptions.Wait } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *SubmitResponse) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Value encoding.JsonList[*api.Submission] `json:"value"` + Type Type `json:"type"` + Value encoding.JsonList[*api.Submission] `json:"value"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Value = v.Value + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -3405,64 +3431,71 @@ func (v *SubscribeRequest) MarshalJSON() ([]byte, error) { Type Type `json:"type"` Partition string `json:"partition,omitempty"` Account *url.URL `json:"account,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.SubscribeOptions.Partition) == 0) { - u.Partition = v.SubscribeOptions.Partition } if !(v.SubscribeOptions.Account == nil) { - u.Account = v.SubscribeOptions.Account } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *SubscribeResponse) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` + Type Type `json:"type"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *ValidateRequest) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Envelope *messaging.Envelope `json:"envelope,omitempty"` - Full *bool `json:"full,omitempty"` + Type Type `json:"type"` + Envelope *messaging.Envelope `json:"envelope,omitempty"` + Full *bool `json:"full,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Envelope == nil) { u.Envelope = v.Envelope } if !(v.ValidateOptions.Full == nil) { - u.Full = v.ValidateOptions.Full } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *ValidateResponse) MarshalJSON() ([]byte, error) { u := struct { - Type Type `json:"type"` - Value encoding.JsonList[*api.Submission] `json:"value"` + Type Type `json:"type"` + Value encoding.JsonList[*api.Submission] `json:"value"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Value = v.Value + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *Addressed) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Message *encoding.JsonUnmarshalWith[Message] `json:"message,omitempty"` - Address *encoding.JsonUnmarshalWith[p2p.Multiaddr] `json:"address,omitempty"` + Type Type `json:"type"` + Message *encoding.JsonUnmarshalWith[Message] `json:"message,omitempty"` + Address *encoding.JsonUnmarshalWith[p2p.Multiaddr] `json:"address,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Message = &encoding.JsonUnmarshalWith[Message]{Value: v.Message, Func: UnmarshalJSON} u.Address = &encoding.JsonUnmarshalWith[p2p.Multiaddr]{Value: v.Address, Func: p2p.UnmarshalMultiaddrJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3476,23 +3509,29 @@ func (v *Addressed) UnmarshalJSON(data []byte) error { v.Address = u.Address.Value } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *ConsensusStatusRequest) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - NodeID string `json:"nodeID,omitempty"` - Partition string `json:"partition,omitempty"` - IncludePeers *bool `json:"includePeers,omitempty"` - IncludeAccumulate *bool `json:"includeAccumulate,omitempty"` + Type Type `json:"type"` + NodeID string `json:"nodeID,omitempty"` + Partition string `json:"partition,omitempty"` + IncludePeers *bool `json:"includePeers,omitempty"` + IncludeAccumulate *bool `json:"includeAccumulate,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.NodeID = v.ConsensusStatusOptions.NodeID u.Partition = v.ConsensusStatusOptions.Partition u.IncludePeers = v.ConsensusStatusOptions.IncludePeers u.IncludeAccumulate = v.ConsensusStatusOptions.IncludeAccumulate - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3502,51 +3541,69 @@ func (v *ConsensusStatusRequest) UnmarshalJSON(data []byte) error { v.ConsensusStatusOptions.Partition = u.Partition v.ConsensusStatusOptions.IncludePeers = u.IncludePeers v.ConsensusStatusOptions.IncludeAccumulate = u.IncludeAccumulate + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *ConsensusStatusResponse) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Value *api.ConsensusStatus `json:"value,omitempty"` + Type Type `json:"type"` + Value *api.ConsensusStatus `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Value = v.Value - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Value = u.Value + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *ErrorResponse) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Error *errors2.Error `json:"error,omitempty"` + Type Type `json:"type"` + Error *errors2.Error `json:"error,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Error = v.Error - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Error = u.Error + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *EventMessage) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Value *encoding.JsonUnmarshalListWith[api.Event] `json:"value"` + Type Type `json:"type"` + Value *encoding.JsonUnmarshalListWith[api.Event] `json:"value"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Value = &encoding.JsonUnmarshalListWith[api.Event]{Value: v.Value, Func: api.UnmarshalEventJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3558,19 +3615,25 @@ func (v *EventMessage) UnmarshalJSON(data []byte) error { v.Value[i] = x } } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *FaucetRequest) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Account *url.URL `json:"account,omitempty"` - Token *url.URL `json:"token,omitempty"` + Type Type `json:"type"` + Account *url.URL `json:"account,omitempty"` + Token *url.URL `json:"token,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Account = v.Account u.Token = v.FaucetOptions.Token - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3578,40 +3641,52 @@ func (v *FaucetRequest) UnmarshalJSON(data []byte) error { } v.Account = u.Account v.FaucetOptions.Token = u.Token + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *FaucetResponse) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Value *api.Submission `json:"value,omitempty"` + Type Type `json:"type"` + Value *api.Submission `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Value = v.Value - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Value = u.Value + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *FindServiceRequest) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Network string `json:"network,omitempty"` - Service *api.ServiceAddress `json:"service,omitempty"` - Known bool `json:"known,omitempty"` - Timeout interface{} `json:"timeout,omitempty"` + Type Type `json:"type"` + Network string `json:"network,omitempty"` + Service *api.ServiceAddress `json:"service,omitempty"` + Known bool `json:"known,omitempty"` + Timeout interface{} `json:"timeout,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Network = v.FindServiceOptions.Network u.Service = v.FindServiceOptions.Service u.Known = v.FindServiceOptions.Known u.Timeout = encoding.DurationToJSON(v.FindServiceOptions.Timeout) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3625,36 +3700,48 @@ func (v *FindServiceRequest) UnmarshalJSON(data []byte) error { } else { v.FindServiceOptions.Timeout = x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *FindServiceResponse) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Value encoding.JsonList[*api.FindServiceResult] `json:"value"` + Type Type `json:"type"` + Value encoding.JsonList[*api.FindServiceResult] `json:"value"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Value = v.Value - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Value = u.Value + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *MetricsRequest) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Partition string `json:"partition,omitempty"` - Span uint64 `json:"span,omitempty"` + Type Type `json:"type"` + Partition string `json:"partition,omitempty"` + Span uint64 `json:"span,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Partition = v.MetricsOptions.Partition u.Span = v.MetricsOptions.Span - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3662,68 +3749,92 @@ func (v *MetricsRequest) UnmarshalJSON(data []byte) error { } v.MetricsOptions.Partition = u.Partition v.MetricsOptions.Span = u.Span + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *MetricsResponse) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Value *api.Metrics `json:"value,omitempty"` + Type Type `json:"type"` + Value *api.Metrics `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Value = v.Value - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Value = u.Value + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *NetworkStatusRequest) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Partition string `json:"partition,omitempty"` + Type Type `json:"type"` + Partition string `json:"partition,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Partition = v.NetworkStatusOptions.Partition - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.NetworkStatusOptions.Partition = u.Partition + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *NetworkStatusResponse) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Value *api.NetworkStatus `json:"value,omitempty"` + Type Type `json:"type"` + Value *api.NetworkStatus `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Value = v.Value - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Value = u.Value + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *NodeInfoRequest) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - PeerID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"peerID,omitempty"` + Type Type `json:"type"` + PeerID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"peerID,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.PeerID = &encoding.JsonUnmarshalWith[p2p.PeerID]{Value: v.NodeInfoOptions.PeerID, Func: p2p.UnmarshalPeerIDJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3733,23 +3844,33 @@ func (v *NodeInfoRequest) UnmarshalJSON(data []byte) error { v.NodeInfoOptions.PeerID = u.PeerID.Value } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *NodeInfoResponse) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Value *api.NodeInfo `json:"value,omitempty"` + Type Type `json:"type"` + Value *api.NodeInfo `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Value = v.Value - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Value = u.Value + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -3760,13 +3881,15 @@ func (v *PrivateSequenceRequest) UnmarshalJSON(data []byte) error { Destination *url.URL `json:"destination,omitempty"` SequenceNumber uint64 `json:"sequenceNumber,omitempty"` NodeID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"nodeID,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Source = v.Source u.Destination = v.Destination u.SequenceNumber = v.SequenceNumber u.NodeID = &encoding.JsonUnmarshalWith[p2p.PeerID]{Value: v.SequenceOptions.NodeID, Func: p2p.UnmarshalPeerIDJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3779,36 +3902,48 @@ func (v *PrivateSequenceRequest) UnmarshalJSON(data []byte) error { v.SequenceOptions.NodeID = u.NodeID.Value } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *PrivateSequenceResponse) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Value *api.MessageRecord[messaging.Message] `json:"value,omitempty"` + Type Type `json:"type"` + Value *api.MessageRecord[messaging.Message] `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Value = v.Value - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Value = u.Value + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *QueryRequest) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Scope *url.URL `json:"scope,omitempty"` - Query *encoding.JsonUnmarshalWith[api.Query] `json:"query,omitempty"` + Type Type `json:"type"` + Scope *url.URL `json:"scope,omitempty"` + Query *encoding.JsonUnmarshalWith[api.Query] `json:"query,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Scope = v.Scope u.Query = &encoding.JsonUnmarshalWith[api.Query]{Value: v.Query, Func: api.UnmarshalQueryJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3819,17 +3954,23 @@ func (v *QueryRequest) UnmarshalJSON(data []byte) error { v.Query = u.Query.Value } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *RecordResponse) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Value *encoding.JsonUnmarshalWith[api.Record] `json:"value,omitempty"` + Type Type `json:"type"` + Value *encoding.JsonUnmarshalWith[api.Record] `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Value = &encoding.JsonUnmarshalWith[api.Record]{Value: v.Value, Func: api.UnmarshalRecordJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3839,21 +3980,27 @@ func (v *RecordResponse) UnmarshalJSON(data []byte) error { v.Value = u.Value.Value } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *SubmitRequest) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Envelope *messaging.Envelope `json:"envelope,omitempty"` - Verify *bool `json:"verify,omitempty"` - Wait *bool `json:"wait,omitempty"` + Type Type `json:"type"` + Envelope *messaging.Envelope `json:"envelope,omitempty"` + Verify *bool `json:"verify,omitempty"` + Wait *bool `json:"wait,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Envelope = v.Envelope u.Verify = v.SubmitOptions.Verify u.Wait = v.SubmitOptions.Wait - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3862,23 +4009,33 @@ func (v *SubmitRequest) UnmarshalJSON(data []byte) error { v.Envelope = u.Envelope v.SubmitOptions.Verify = u.Verify v.SubmitOptions.Wait = u.Wait + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *SubmitResponse) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Value encoding.JsonList[*api.Submission] `json:"value"` + Type Type `json:"type"` + Value encoding.JsonList[*api.Submission] `json:"value"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Value = v.Value - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Value = u.Value + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -3887,11 +4044,13 @@ func (v *SubscribeRequest) UnmarshalJSON(data []byte) error { Type Type `json:"type"` Partition string `json:"partition,omitempty"` Account *url.URL `json:"account,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Partition = v.SubscribeOptions.Partition u.Account = v.SubscribeOptions.Account - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3899,33 +4058,45 @@ func (v *SubscribeRequest) UnmarshalJSON(data []byte) error { } v.SubscribeOptions.Partition = u.Partition v.SubscribeOptions.Account = u.Account + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *SubscribeResponse) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` + Type Type `json:"type"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *ValidateRequest) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Envelope *messaging.Envelope `json:"envelope,omitempty"` - Full *bool `json:"full,omitempty"` + Type Type `json:"type"` + Envelope *messaging.Envelope `json:"envelope,omitempty"` + Full *bool `json:"full,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Envelope = v.Envelope u.Full = v.ValidateOptions.Full - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3933,22 +4104,32 @@ func (v *ValidateRequest) UnmarshalJSON(data []byte) error { } v.Envelope = u.Envelope v.ValidateOptions.Full = u.Full + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *ValidateResponse) UnmarshalJSON(data []byte) error { u := struct { - Type Type `json:"type"` - Value encoding.JsonList[*api.Submission] `json:"value"` + Type Type `json:"type"` + Value encoding.JsonList[*api.Submission] `json:"value"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Value = v.Value - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Value = u.Value + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } diff --git a/pkg/api/v3/p2p/peerdb/types_gen.go b/pkg/api/v3/p2p/peerdb/types_gen.go index f973e42b3..a72f6581b 100644 --- a/pkg/api/v3/p2p/peerdb/types_gen.go +++ b/pkg/api/v3/p2p/peerdb/types_gen.go @@ -276,7 +276,8 @@ func (v *PeerAddressStatus) UnmarshalJSON(data []byte) error { }{} u.Address = &encoding.JsonUnmarshalWith[p2p.Multiaddr]{Value: v.Address, Func: p2p.UnmarshalMultiaddrJSON} u.Last = v.Last - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if u.Address != nil { diff --git a/pkg/api/v3/p2p/types_gen.go b/pkg/api/v3/p2p/types_gen.go index 7290aa191..ad45cfdcc 100644 --- a/pkg/api/v3/p2p/types_gen.go +++ b/pkg/api/v3/p2p/types_gen.go @@ -185,10 +185,11 @@ func (v *serviceRegisteredEvent) UnmarshalFieldsFrom(reader *encoding.Reader) er func (v *serviceRegisteredEvent) MarshalJSON() ([]byte, error) { u := struct { - Type eventType `json:"type"` - PeerID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"peerID,omitempty"` - Network string `json:"network,omitempty"` - Address *api.ServiceAddress `json:"address,omitempty"` + Type eventType `json:"type"` + PeerID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"peerID,omitempty"` + Network string `json:"network,omitempty"` + Address *api.ServiceAddress `json:"address,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.PeerID == ("")) { @@ -200,21 +201,24 @@ func (v *serviceRegisteredEvent) MarshalJSON() ([]byte, error) { if !(v.Address == nil) { u.Address = v.Address } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *serviceRegisteredEvent) UnmarshalJSON(data []byte) error { u := struct { - Type eventType `json:"type"` - PeerID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"peerID,omitempty"` - Network string `json:"network,omitempty"` - Address *api.ServiceAddress `json:"address,omitempty"` + Type eventType `json:"type"` + PeerID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"peerID,omitempty"` + Network string `json:"network,omitempty"` + Address *api.ServiceAddress `json:"address,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.PeerID = &encoding.JsonUnmarshalWith[p2p.PeerID]{Value: v.PeerID, Func: p2p.UnmarshalPeerIDJSON} u.Network = v.Network u.Address = v.Address - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -226,5 +230,9 @@ func (v *serviceRegisteredEvent) UnmarshalJSON(data []byte) error { v.Network = u.Network v.Address = u.Address + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } diff --git a/pkg/api/v3/types_gen.go b/pkg/api/v3/types_gen.go index 8ce94766c..1f38f8e89 100644 --- a/pkg/api/v3/types_gen.go +++ b/pkg/api/v3/types_gen.go @@ -7437,6 +7437,7 @@ func (v *AccountRecord) MarshalJSON() ([]byte, error) { Pending *RecordRange[*TxIDRecord] `json:"pending,omitempty"` Receipt *Receipt `json:"receipt,omitempty"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() if !(protocol.EqualAccount(v.Account, nil)) { @@ -7454,6 +7455,7 @@ func (v *AccountRecord) MarshalJSON() ([]byte, error) { if !(v.LastBlockTime == nil) { u.LastBlockTime = v.LastBlockTime } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7462,6 +7464,7 @@ func (v *AnchorSearchQuery) MarshalJSON() ([]byte, error) { QueryType QueryType `json:"queryType"` Anchor *string `json:"anchor,omitempty"` IncludeReceipt *ReceiptOptions `json:"includeReceipt,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() if !(len(v.Anchor) == 0) { @@ -7470,6 +7473,7 @@ func (v *AnchorSearchQuery) MarshalJSON() ([]byte, error) { if !(v.IncludeReceipt == nil) { u.IncludeReceipt = v.IncludeReceipt } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7481,6 +7485,7 @@ func (v *BlockEvent) MarshalJSON() ([]byte, error) { Time time.Time `json:"time,omitempty"` Major uint64 `json:"major,omitempty"` Entries encoding.JsonList[*ChainEntryRecord[Record]] `json:"entries,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.EventType = v.EventType() if !(len(v.Partition) == 0) { @@ -7498,6 +7503,7 @@ func (v *BlockEvent) MarshalJSON() ([]byte, error) { if !(len(v.Entries) == 0) { u.Entries = v.Entries } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7510,6 +7516,7 @@ func (v *BlockQuery) MarshalJSON() ([]byte, error) { MajorRange *RangeOptions `json:"majorRange,omitempty"` EntryRange *RangeOptions `json:"entryRange,omitempty"` OmitEmpty bool `json:"omitEmpty,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() if !(v.Minor == nil) { @@ -7530,6 +7537,7 @@ func (v *BlockQuery) MarshalJSON() ([]byte, error) { if !(!v.OmitEmpty) { u.OmitEmpty = v.OmitEmpty } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7545,6 +7553,7 @@ func (v *ChainEntryRecord[T]) MarshalJSON() ([]byte, error) { Receipt *Receipt `json:"receipt,omitempty"` State encoding.JsonList[*string] `json:"state,omitempty"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() if !(v.Account == nil) { @@ -7575,6 +7584,7 @@ func (v *ChainEntryRecord[T]) MarshalJSON() ([]byte, error) { if !(v.LastBlockTime == nil) { u.LastBlockTime = v.LastBlockTime } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7586,6 +7596,7 @@ func (v *ChainQuery) MarshalJSON() ([]byte, error) { Entry *string `json:"entry,omitempty"` Range *RangeOptions `json:"range,omitempty"` IncludeReceipt *ReceiptOptions `json:"includeReceipt,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() if !(len(v.Name) == 0) { @@ -7603,6 +7614,7 @@ func (v *ChainQuery) MarshalJSON() ([]byte, error) { if !(v.IncludeReceipt == nil) { u.IncludeReceipt = v.IncludeReceipt } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7614,6 +7626,7 @@ func (v *ChainRecord) MarshalJSON() ([]byte, error) { Count uint64 `json:"count,omitempty"` State encoding.JsonList[*string] `json:"state,omitempty"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() if !(len(v.Name) == 0) { @@ -7634,6 +7647,7 @@ func (v *ChainRecord) MarshalJSON() ([]byte, error) { if !(v.LastBlockTime == nil) { u.LastBlockTime = v.LastBlockTime } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7648,6 +7662,7 @@ func (v *ConsensusStatus) MarshalJSON() ([]byte, error) { PartitionID string `json:"partitionID,omitempty"` PartitionType protocol.PartitionType `json:"partitionType,omitempty"` Peers encoding.JsonList[*ConsensusPeerInfo] `json:"peers,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(!v.Ok) { u.Ok = v.Ok @@ -7676,6 +7691,7 @@ func (v *ConsensusStatus) MarshalJSON() ([]byte, error) { if !(len(v.Peers) == 0) { u.Peers = v.Peers } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7685,6 +7701,7 @@ func (v *DataQuery) MarshalJSON() ([]byte, error) { Index *uint64 `json:"index,omitempty"` Entry *string `json:"entry,omitempty"` Range *RangeOptions `json:"range,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() if !(v.Index == nil) { @@ -7696,6 +7713,7 @@ func (v *DataQuery) MarshalJSON() ([]byte, error) { if !(v.Range == nil) { u.Range = v.Range } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7703,11 +7721,13 @@ func (v *DefaultQuery) MarshalJSON() ([]byte, error) { u := struct { QueryType QueryType `json:"queryType"` IncludeReceipt *ReceiptOptions `json:"includeReceipt,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() if !(v.IncludeReceipt == nil) { u.IncludeReceipt = v.IncludeReceipt } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7715,11 +7735,13 @@ func (v *DelegateSearchQuery) MarshalJSON() ([]byte, error) { u := struct { QueryType QueryType `json:"queryType"` Delegate *url.URL `json:"delegate,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() if !(v.Delegate == nil) { u.Delegate = v.Delegate } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7727,11 +7749,13 @@ func (v *DirectoryQuery) MarshalJSON() ([]byte, error) { u := struct { QueryType QueryType `json:"queryType"` Range *RangeOptions `json:"range,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() if !(v.Range == nil) { u.Range = v.Range } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7739,11 +7763,13 @@ func (v *ErrorEvent) MarshalJSON() ([]byte, error) { u := struct { EventType EventType `json:"eventType"` Err *errors2.Error `json:"err,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.EventType = v.EventType() if !(v.Err == nil) { u.Err = v.Err } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7751,20 +7777,23 @@ func (v *ErrorRecord) MarshalJSON() ([]byte, error) { u := struct { RecordType RecordType `json:"recordType"` Value *errors2.Error `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() if !(v.Value == nil) { u.Value = v.Value } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *FindServiceOptions) MarshalJSON() ([]byte, error) { u := struct { - Network string `json:"network,omitempty"` - Service *ServiceAddress `json:"service,omitempty"` - Known bool `json:"known,omitempty"` - Timeout interface{} `json:"timeout,omitempty"` + Network string `json:"network,omitempty"` + Service *ServiceAddress `json:"service,omitempty"` + Known bool `json:"known,omitempty"` + Timeout interface{} `json:"timeout,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Network) == 0) { u.Network = v.Network @@ -7778,6 +7807,7 @@ func (v *FindServiceOptions) MarshalJSON() ([]byte, error) { if !(v.Timeout == 0) { u.Timeout = encoding.DurationToJSON(v.Timeout) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7786,6 +7816,7 @@ func (v *FindServiceResult) MarshalJSON() ([]byte, error) { PeerID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"peerID,omitempty"` Status KnownPeerStatus `json:"status,omitempty"` Addresses *encoding.JsonUnmarshalListWith[p2p.Multiaddr] `json:"addresses,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.PeerID == ("")) { u.PeerID = &encoding.JsonUnmarshalWith[p2p.PeerID]{Value: v.PeerID, Func: p2p.UnmarshalPeerIDJSON} @@ -7796,6 +7827,7 @@ func (v *FindServiceResult) MarshalJSON() ([]byte, error) { if !(len(v.Addresses) == 0) { u.Addresses = &encoding.JsonUnmarshalListWith[p2p.Multiaddr]{Value: v.Addresses, Func: p2p.UnmarshalMultiaddrJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7804,6 +7836,7 @@ func (v *GlobalsEvent) MarshalJSON() ([]byte, error) { EventType EventType `json:"eventType"` Old *core.GlobalValues `json:"old,omitempty"` New *core.GlobalValues `json:"new,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.EventType = v.EventType() if !(v.Old == nil) { @@ -7812,6 +7845,7 @@ func (v *GlobalsEvent) MarshalJSON() ([]byte, error) { if !(v.New == nil) { u.New = v.New } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7819,11 +7853,13 @@ func (v *IndexEntryRecord) MarshalJSON() ([]byte, error) { u := struct { RecordType RecordType `json:"recordType"` Value *protocol.IndexEntry `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() if !(v.Value == nil) { u.Value = v.Value } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7835,6 +7871,7 @@ func (v *KeyRecord) MarshalJSON() ([]byte, error) { Version uint64 `json:"version,omitempty"` Index uint64 `json:"index,omitempty"` Entry *protocol.KeySpec `json:"entry,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() if !(v.Authority == nil) { @@ -7852,6 +7889,7 @@ func (v *KeyRecord) MarshalJSON() ([]byte, error) { if !(v.Entry == nil) { u.Entry = v.Entry } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7862,6 +7900,7 @@ func (v *LastBlock) MarshalJSON() ([]byte, error) { ChainRoot *string `json:"chainRoot,omitempty"` StateRoot *string `json:"stateRoot,omitempty"` DirectoryAnchorHeight uint64 `json:"directoryAnchorHeight,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Height == 0) { u.Height = v.Height @@ -7878,6 +7917,7 @@ func (v *LastBlock) MarshalJSON() ([]byte, error) { if !(v.DirectoryAnchorHeight == 0) { u.DirectoryAnchorHeight = v.DirectoryAnchorHeight } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7888,6 +7928,7 @@ func (v *MajorBlockRecord) MarshalJSON() ([]byte, error) { Time time.Time `json:"time,omitempty"` MinorBlocks *RecordRange[*MinorBlockRecord] `json:"minorBlocks,omitempty"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() if !(v.Index == 0) { @@ -7902,6 +7943,7 @@ func (v *MajorBlockRecord) MarshalJSON() ([]byte, error) { if !(v.LastBlockTime == nil) { u.LastBlockTime = v.LastBlockTime } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7909,11 +7951,13 @@ func (v *MessageHashSearchQuery) MarshalJSON() ([]byte, error) { u := struct { QueryType QueryType `json:"queryType"` Hash *string `json:"hash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() if !(v.Hash == ([32]byte{})) { u.Hash = encoding.ChainToJSON(&v.Hash) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7934,6 +7978,7 @@ func (v *MessageRecord[T]) MarshalJSON() ([]byte, error) { Sequence *messaging.SequencedMessage `json:"sequence,omitempty"` SourceReceipt *merkle.Receipt `json:"sourceReceipt,omitempty"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() if !(v.ID == nil) { @@ -7978,6 +8023,7 @@ func (v *MessageRecord[T]) MarshalJSON() ([]byte, error) { if !(v.LastBlockTime == nil) { u.LastBlockTime = v.LastBlockTime } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -7990,6 +8036,7 @@ func (v *MinorBlockRecord) MarshalJSON() ([]byte, error) { Entries *RecordRange[*ChainEntryRecord[Record]] `json:"entries,omitempty"` Anchored *RecordRange[*MinorBlockRecord] `json:"anchored,omitempty"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() if !(v.Index == 0) { @@ -8010,6 +8057,7 @@ func (v *MinorBlockRecord) MarshalJSON() ([]byte, error) { if !(v.LastBlockTime == nil) { u.LastBlockTime = v.LastBlockTime } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -8023,6 +8071,7 @@ func (v *NetworkStatus) MarshalJSON() ([]byte, error) { DirectoryHeight uint64 `json:"directoryHeight,omitempty"` MajorBlockHeight uint64 `json:"majorBlockHeight,omitempty"` BvnExecutorVersions encoding.JsonList[*protocol.PartitionExecutorVersion] `json:"bvnExecutorVersions,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Oracle == nil) { u.Oracle = v.Oracle @@ -8048,16 +8097,18 @@ func (v *NetworkStatus) MarshalJSON() ([]byte, error) { if !(len(v.BvnExecutorVersions) == 0) { u.BvnExecutorVersions = v.BvnExecutorVersions } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *NodeInfo) MarshalJSON() ([]byte, error) { u := struct { - PeerID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"peerID,omitempty"` - Network string `json:"network,omitempty"` - Services encoding.JsonList[*ServiceAddress] `json:"services,omitempty"` - Version string `json:"version,omitempty"` - Commit string `json:"commit,omitempty"` + PeerID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"peerID,omitempty"` + Network string `json:"network,omitempty"` + Services encoding.JsonList[*ServiceAddress] `json:"services,omitempty"` + Version string `json:"version,omitempty"` + Commit string `json:"commit,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.PeerID == ("")) { u.PeerID = &encoding.JsonUnmarshalWith[p2p.PeerID]{Value: v.PeerID, Func: p2p.UnmarshalPeerIDJSON} @@ -8074,16 +8125,19 @@ func (v *NodeInfo) MarshalJSON() ([]byte, error) { if !(len(v.Commit) == 0) { u.Commit = v.Commit } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *NodeInfoOptions) MarshalJSON() ([]byte, error) { u := struct { - PeerID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"peerID,omitempty"` + PeerID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"peerID,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.PeerID == ("")) { u.PeerID = &encoding.JsonUnmarshalWith[p2p.PeerID]{Value: v.PeerID, Func: p2p.UnmarshalPeerIDJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -8091,11 +8145,13 @@ func (v *PendingQuery) MarshalJSON() ([]byte, error) { u := struct { QueryType QueryType `json:"queryType"` Range *RangeOptions `json:"range,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() if !(v.Range == nil) { u.Range = v.Range } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -8103,11 +8159,13 @@ func (v *PublicKeyHashSearchQuery) MarshalJSON() ([]byte, error) { u := struct { QueryType QueryType `json:"queryType"` PublicKeyHash *string `json:"publicKeyHash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() if !(len(v.PublicKeyHash) == 0) { u.PublicKeyHash = encoding.BytesToJSON(v.PublicKeyHash) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -8116,6 +8174,7 @@ func (v *PublicKeySearchQuery) MarshalJSON() ([]byte, error) { QueryType QueryType `json:"queryType"` PublicKey *string `json:"publicKey,omitempty"` Type protocol.SignatureType `json:"type,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() if !(len(v.PublicKey) == 0) { @@ -8124,6 +8183,7 @@ func (v *PublicKeySearchQuery) MarshalJSON() ([]byte, error) { if !(v.Type == 0) { u.Type = v.Type } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -8138,29 +8198,24 @@ func (v *Receipt) MarshalJSON() ([]byte, error) { LocalBlock uint64 `json:"localBlock,omitempty"` LocalBlockTime time.Time `json:"localBlockTime,omitempty"` MajorBlock uint64 `json:"majorBlock,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Receipt.Start) == 0) { - u.Start = encoding.BytesToJSON(v.Receipt.Start) } if !(v.Receipt.StartIndex == 0) { - u.StartIndex = v.Receipt.StartIndex } if !(len(v.Receipt.End) == 0) { - u.End = encoding.BytesToJSON(v.Receipt.End) } if !(v.Receipt.EndIndex == 0) { - u.EndIndex = v.Receipt.EndIndex } if !(len(v.Receipt.Anchor) == 0) { - u.Anchor = encoding.BytesToJSON(v.Receipt.Anchor) } if !(len(v.Receipt.Entries) == 0) { - u.Entries = v.Receipt.Entries } if !(v.LocalBlock == 0) { @@ -8172,6 +8227,7 @@ func (v *Receipt) MarshalJSON() ([]byte, error) { if !(v.MajorBlock == 0) { u.MajorBlock = v.MajorBlock } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -8182,6 +8238,7 @@ func (v *RecordRange[T]) MarshalJSON() ([]byte, error) { Start uint64 `json:"start"` Total uint64 `json:"total"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() if !(len(v.Records) == 0) { @@ -8192,6 +8249,7 @@ func (v *RecordRange[T]) MarshalJSON() ([]byte, error) { if !(v.LastBlockTime == nil) { u.LastBlockTime = v.LastBlockTime } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -8200,6 +8258,7 @@ func (v *SignatureSetRecord) MarshalJSON() ([]byte, error) { RecordType RecordType `json:"recordType"` Account *encoding.JsonUnmarshalWith[protocol.Account] `json:"account,omitempty"` Signatures *RecordRange[*MessageRecord[messaging.Message]] `json:"signatures,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() if !(protocol.EqualAccount(v.Account, nil)) { @@ -8208,6 +8267,7 @@ func (v *SignatureSetRecord) MarshalJSON() ([]byte, error) { if !(v.Signatures == nil) { u.Signatures = v.Signatures } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -8215,11 +8275,13 @@ func (v *TxIDRecord) MarshalJSON() ([]byte, error) { u := struct { RecordType RecordType `json:"recordType"` Value *url.TxID `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() if !(v.Value == nil) { u.Value = v.Value } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -8227,11 +8289,13 @@ func (v *UrlRecord) MarshalJSON() ([]byte, error) { u := struct { RecordType RecordType `json:"recordType"` Value *url.URL `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() if !(v.Value == nil) { u.Value = v.Value } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -8243,6 +8307,7 @@ func (v *AccountRecord) UnmarshalJSON(data []byte) error { Pending *RecordRange[*TxIDRecord] `json:"pending,omitempty"` Receipt *Receipt `json:"receipt,omitempty"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() u.Account = &encoding.JsonUnmarshalWith[protocol.Account]{Value: v.Account, Func: protocol.UnmarshalAccountJSON} @@ -8250,7 +8315,8 @@ func (v *AccountRecord) UnmarshalJSON(data []byte) error { u.Pending = v.Pending u.Receipt = v.Receipt u.LastBlockTime = v.LastBlockTime - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.RecordType() == u.RecordType) { @@ -8264,6 +8330,10 @@ func (v *AccountRecord) UnmarshalJSON(data []byte) error { v.Pending = u.Pending v.Receipt = u.Receipt v.LastBlockTime = u.LastBlockTime + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8272,11 +8342,13 @@ func (v *AnchorSearchQuery) UnmarshalJSON(data []byte) error { QueryType QueryType `json:"queryType"` Anchor *string `json:"anchor,omitempty"` IncludeReceipt *ReceiptOptions `json:"includeReceipt,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() u.Anchor = encoding.BytesToJSON(v.Anchor) u.IncludeReceipt = v.IncludeReceipt - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.QueryType() == u.QueryType) { @@ -8288,6 +8360,10 @@ func (v *AnchorSearchQuery) UnmarshalJSON(data []byte) error { v.Anchor = x } v.IncludeReceipt = u.IncludeReceipt + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8299,6 +8375,7 @@ func (v *BlockEvent) UnmarshalJSON(data []byte) error { Time time.Time `json:"time,omitempty"` Major uint64 `json:"major,omitempty"` Entries encoding.JsonList[*ChainEntryRecord[Record]] `json:"entries,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.EventType = v.EventType() u.Partition = v.Partition @@ -8306,7 +8383,8 @@ func (v *BlockEvent) UnmarshalJSON(data []byte) error { u.Time = v.Time u.Major = v.Major u.Entries = v.Entries - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.EventType() == u.EventType) { @@ -8317,6 +8395,10 @@ func (v *BlockEvent) UnmarshalJSON(data []byte) error { v.Time = u.Time v.Major = u.Major v.Entries = u.Entries + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8329,6 +8411,7 @@ func (v *BlockQuery) UnmarshalJSON(data []byte) error { MajorRange *RangeOptions `json:"majorRange,omitempty"` EntryRange *RangeOptions `json:"entryRange,omitempty"` OmitEmpty bool `json:"omitEmpty,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() u.Minor = v.Minor @@ -8337,7 +8420,8 @@ func (v *BlockQuery) UnmarshalJSON(data []byte) error { u.MajorRange = v.MajorRange u.EntryRange = v.EntryRange u.OmitEmpty = v.OmitEmpty - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.QueryType() == u.QueryType) { @@ -8349,6 +8433,10 @@ func (v *BlockQuery) UnmarshalJSON(data []byte) error { v.MajorRange = u.MajorRange v.EntryRange = u.EntryRange v.OmitEmpty = u.OmitEmpty + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8364,6 +8452,7 @@ func (v *ChainEntryRecord[T]) UnmarshalJSON(data []byte) error { Receipt *Receipt `json:"receipt,omitempty"` State encoding.JsonList[*string] `json:"state,omitempty"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() u.Account = v.Account @@ -8378,7 +8467,8 @@ func (v *ChainEntryRecord[T]) UnmarshalJSON(data []byte) error { u.State[i] = encoding.BytesToJSON(x) } u.LastBlockTime = v.LastBlockTime - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.RecordType() == u.RecordType) { @@ -8407,6 +8497,10 @@ func (v *ChainEntryRecord[T]) UnmarshalJSON(data []byte) error { } } v.LastBlockTime = u.LastBlockTime + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8418,6 +8512,7 @@ func (v *ChainQuery) UnmarshalJSON(data []byte) error { Entry *string `json:"entry,omitempty"` Range *RangeOptions `json:"range,omitempty"` IncludeReceipt *ReceiptOptions `json:"includeReceipt,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() u.Name = v.Name @@ -8425,7 +8520,8 @@ func (v *ChainQuery) UnmarshalJSON(data []byte) error { u.Entry = encoding.BytesToJSON(v.Entry) u.Range = v.Range u.IncludeReceipt = v.IncludeReceipt - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.QueryType() == u.QueryType) { @@ -8440,6 +8536,10 @@ func (v *ChainQuery) UnmarshalJSON(data []byte) error { } v.Range = u.Range v.IncludeReceipt = u.IncludeReceipt + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8451,6 +8551,7 @@ func (v *ChainRecord) UnmarshalJSON(data []byte) error { Count uint64 `json:"count,omitempty"` State encoding.JsonList[*string] `json:"state,omitempty"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() u.Name = v.Name @@ -8461,7 +8562,8 @@ func (v *ChainRecord) UnmarshalJSON(data []byte) error { u.State[i] = encoding.BytesToJSON(x) } u.LastBlockTime = v.LastBlockTime - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.RecordType() == u.RecordType) { @@ -8479,6 +8581,10 @@ func (v *ChainRecord) UnmarshalJSON(data []byte) error { } } v.LastBlockTime = u.LastBlockTime + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8493,6 +8599,7 @@ func (v *ConsensusStatus) UnmarshalJSON(data []byte) error { PartitionID string `json:"partitionID,omitempty"` PartitionType protocol.PartitionType `json:"partitionType,omitempty"` Peers encoding.JsonList[*ConsensusPeerInfo] `json:"peers,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Ok = v.Ok u.LastBlock = v.LastBlock @@ -8503,7 +8610,8 @@ func (v *ConsensusStatus) UnmarshalJSON(data []byte) error { u.PartitionID = v.PartitionID u.PartitionType = v.PartitionType u.Peers = v.Peers - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Ok = u.Ok @@ -8523,6 +8631,10 @@ func (v *ConsensusStatus) UnmarshalJSON(data []byte) error { v.PartitionID = u.PartitionID v.PartitionType = u.PartitionType v.Peers = u.Peers + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8532,12 +8644,14 @@ func (v *DataQuery) UnmarshalJSON(data []byte) error { Index *uint64 `json:"index,omitempty"` Entry *string `json:"entry,omitempty"` Range *RangeOptions `json:"range,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() u.Index = v.Index u.Entry = encoding.BytesToJSON(v.Entry) u.Range = v.Range - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.QueryType() == u.QueryType) { @@ -8550,6 +8664,10 @@ func (v *DataQuery) UnmarshalJSON(data []byte) error { v.Entry = x } v.Range = u.Range + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8557,16 +8675,22 @@ func (v *DefaultQuery) UnmarshalJSON(data []byte) error { u := struct { QueryType QueryType `json:"queryType"` IncludeReceipt *ReceiptOptions `json:"includeReceipt,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() u.IncludeReceipt = v.IncludeReceipt - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.QueryType() == u.QueryType) { return fmt.Errorf("field QueryType: not equal: want %v, got %v", v.QueryType(), u.QueryType) } v.IncludeReceipt = u.IncludeReceipt + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8574,16 +8698,22 @@ func (v *DelegateSearchQuery) UnmarshalJSON(data []byte) error { u := struct { QueryType QueryType `json:"queryType"` Delegate *url.URL `json:"delegate,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() u.Delegate = v.Delegate - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.QueryType() == u.QueryType) { return fmt.Errorf("field QueryType: not equal: want %v, got %v", v.QueryType(), u.QueryType) } v.Delegate = u.Delegate + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8591,16 +8721,22 @@ func (v *DirectoryQuery) UnmarshalJSON(data []byte) error { u := struct { QueryType QueryType `json:"queryType"` Range *RangeOptions `json:"range,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() u.Range = v.Range - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.QueryType() == u.QueryType) { return fmt.Errorf("field QueryType: not equal: want %v, got %v", v.QueryType(), u.QueryType) } v.Range = u.Range + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8608,16 +8744,22 @@ func (v *ErrorEvent) UnmarshalJSON(data []byte) error { u := struct { EventType EventType `json:"eventType"` Err *errors2.Error `json:"err,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.EventType = v.EventType() u.Err = v.Err - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.EventType() == u.EventType) { return fmt.Errorf("field EventType: not equal: want %v, got %v", v.EventType(), u.EventType) } v.Err = u.Err + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8625,31 +8767,39 @@ func (v *ErrorRecord) UnmarshalJSON(data []byte) error { u := struct { RecordType RecordType `json:"recordType"` Value *errors2.Error `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() u.Value = v.Value - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.RecordType() == u.RecordType) { return fmt.Errorf("field RecordType: not equal: want %v, got %v", v.RecordType(), u.RecordType) } v.Value = u.Value + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *FindServiceOptions) UnmarshalJSON(data []byte) error { u := struct { - Network string `json:"network,omitempty"` - Service *ServiceAddress `json:"service,omitempty"` - Known bool `json:"known,omitempty"` - Timeout interface{} `json:"timeout,omitempty"` + Network string `json:"network,omitempty"` + Service *ServiceAddress `json:"service,omitempty"` + Known bool `json:"known,omitempty"` + Timeout interface{} `json:"timeout,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Network = v.Network u.Service = v.Service u.Known = v.Known u.Timeout = encoding.DurationToJSON(v.Timeout) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Network = u.Network @@ -8660,6 +8810,10 @@ func (v *FindServiceOptions) UnmarshalJSON(data []byte) error { } else { v.Timeout = x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8668,11 +8822,13 @@ func (v *FindServiceResult) UnmarshalJSON(data []byte) error { PeerID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"peerID,omitempty"` Status KnownPeerStatus `json:"status,omitempty"` Addresses *encoding.JsonUnmarshalListWith[p2p.Multiaddr] `json:"addresses,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.PeerID = &encoding.JsonUnmarshalWith[p2p.PeerID]{Value: v.PeerID, Func: p2p.UnmarshalPeerIDJSON} u.Status = v.Status u.Addresses = &encoding.JsonUnmarshalListWith[p2p.Multiaddr]{Value: v.Addresses, Func: p2p.UnmarshalMultiaddrJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if u.PeerID != nil { @@ -8686,6 +8842,10 @@ func (v *FindServiceResult) UnmarshalJSON(data []byte) error { v.Addresses[i] = x } } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8694,11 +8854,13 @@ func (v *GlobalsEvent) UnmarshalJSON(data []byte) error { EventType EventType `json:"eventType"` Old *core.GlobalValues `json:"old,omitempty"` New *core.GlobalValues `json:"new,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.EventType = v.EventType() u.Old = v.Old u.New = v.New - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.EventType() == u.EventType) { @@ -8706,6 +8868,10 @@ func (v *GlobalsEvent) UnmarshalJSON(data []byte) error { } v.Old = u.Old v.New = u.New + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8713,16 +8879,22 @@ func (v *IndexEntryRecord) UnmarshalJSON(data []byte) error { u := struct { RecordType RecordType `json:"recordType"` Value *protocol.IndexEntry `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() u.Value = v.Value - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.RecordType() == u.RecordType) { return fmt.Errorf("field RecordType: not equal: want %v, got %v", v.RecordType(), u.RecordType) } v.Value = u.Value + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8734,6 +8906,7 @@ func (v *KeyRecord) UnmarshalJSON(data []byte) error { Version uint64 `json:"version,omitempty"` Index uint64 `json:"index,omitempty"` Entry *protocol.KeySpec `json:"entry,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() u.Authority = v.Authority @@ -8741,7 +8914,8 @@ func (v *KeyRecord) UnmarshalJSON(data []byte) error { u.Version = v.Version u.Index = v.Index u.Entry = v.Entry - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.RecordType() == u.RecordType) { @@ -8752,6 +8926,10 @@ func (v *KeyRecord) UnmarshalJSON(data []byte) error { v.Version = u.Version v.Index = u.Index v.Entry = u.Entry + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8762,13 +8940,15 @@ func (v *LastBlock) UnmarshalJSON(data []byte) error { ChainRoot *string `json:"chainRoot,omitempty"` StateRoot *string `json:"stateRoot,omitempty"` DirectoryAnchorHeight uint64 `json:"directoryAnchorHeight,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Height = v.Height u.Time = v.Time u.ChainRoot = encoding.ChainToJSON(&v.ChainRoot) u.StateRoot = encoding.ChainToJSON(&v.StateRoot) u.DirectoryAnchorHeight = v.DirectoryAnchorHeight - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Height = u.Height @@ -8784,6 +8964,10 @@ func (v *LastBlock) UnmarshalJSON(data []byte) error { v.StateRoot = *x } v.DirectoryAnchorHeight = u.DirectoryAnchorHeight + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8794,13 +8978,15 @@ func (v *MajorBlockRecord) UnmarshalJSON(data []byte) error { Time time.Time `json:"time,omitempty"` MinorBlocks *RecordRange[*MinorBlockRecord] `json:"minorBlocks,omitempty"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() u.Index = v.Index u.Time = v.Time u.MinorBlocks = v.MinorBlocks u.LastBlockTime = v.LastBlockTime - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.RecordType() == u.RecordType) { @@ -8810,6 +8996,10 @@ func (v *MajorBlockRecord) UnmarshalJSON(data []byte) error { v.Time = u.Time v.MinorBlocks = u.MinorBlocks v.LastBlockTime = u.LastBlockTime + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8817,10 +9007,12 @@ func (v *MessageHashSearchQuery) UnmarshalJSON(data []byte) error { u := struct { QueryType QueryType `json:"queryType"` Hash *string `json:"hash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() u.Hash = encoding.ChainToJSON(&v.Hash) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.QueryType() == u.QueryType) { @@ -8831,6 +9023,10 @@ func (v *MessageHashSearchQuery) UnmarshalJSON(data []byte) error { } else { v.Hash = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8851,6 +9047,7 @@ func (v *MessageRecord[T]) UnmarshalJSON(data []byte) error { Sequence *messaging.SequencedMessage `json:"sequence,omitempty"` SourceReceipt *merkle.Receipt `json:"sourceReceipt,omitempty"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() u.ID = v.ID @@ -8867,7 +9064,8 @@ func (v *MessageRecord[T]) UnmarshalJSON(data []byte) error { u.Sequence = v.Sequence u.SourceReceipt = v.SourceReceipt u.LastBlockTime = v.LastBlockTime - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.RecordType() == u.RecordType) { @@ -8892,6 +9090,10 @@ func (v *MessageRecord[T]) UnmarshalJSON(data []byte) error { v.Sequence = u.Sequence v.SourceReceipt = u.SourceReceipt v.LastBlockTime = u.LastBlockTime + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8904,6 +9106,7 @@ func (v *MinorBlockRecord) UnmarshalJSON(data []byte) error { Entries *RecordRange[*ChainEntryRecord[Record]] `json:"entries,omitempty"` Anchored *RecordRange[*MinorBlockRecord] `json:"anchored,omitempty"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() u.Index = v.Index @@ -8912,7 +9115,8 @@ func (v *MinorBlockRecord) UnmarshalJSON(data []byte) error { u.Entries = v.Entries u.Anchored = v.Anchored u.LastBlockTime = v.LastBlockTime - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.RecordType() == u.RecordType) { @@ -8924,6 +9128,10 @@ func (v *MinorBlockRecord) UnmarshalJSON(data []byte) error { v.Entries = u.Entries v.Anchored = u.Anchored v.LastBlockTime = u.LastBlockTime + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -8937,6 +9145,7 @@ func (v *NetworkStatus) UnmarshalJSON(data []byte) error { DirectoryHeight uint64 `json:"directoryHeight,omitempty"` MajorBlockHeight uint64 `json:"majorBlockHeight,omitempty"` BvnExecutorVersions encoding.JsonList[*protocol.PartitionExecutorVersion] `json:"bvnExecutorVersions,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Oracle = v.Oracle u.Globals = v.Globals @@ -8946,7 +9155,8 @@ func (v *NetworkStatus) UnmarshalJSON(data []byte) error { u.DirectoryHeight = v.DirectoryHeight u.MajorBlockHeight = v.MajorBlockHeight u.BvnExecutorVersions = v.BvnExecutorVersions - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Oracle = u.Oracle @@ -8957,23 +9167,29 @@ func (v *NetworkStatus) UnmarshalJSON(data []byte) error { v.DirectoryHeight = u.DirectoryHeight v.MajorBlockHeight = u.MajorBlockHeight v.BvnExecutorVersions = u.BvnExecutorVersions + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *NodeInfo) UnmarshalJSON(data []byte) error { u := struct { - PeerID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"peerID,omitempty"` - Network string `json:"network,omitempty"` - Services encoding.JsonList[*ServiceAddress] `json:"services,omitempty"` - Version string `json:"version,omitempty"` - Commit string `json:"commit,omitempty"` + PeerID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"peerID,omitempty"` + Network string `json:"network,omitempty"` + Services encoding.JsonList[*ServiceAddress] `json:"services,omitempty"` + Version string `json:"version,omitempty"` + Commit string `json:"commit,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.PeerID = &encoding.JsonUnmarshalWith[p2p.PeerID]{Value: v.PeerID, Func: p2p.UnmarshalPeerIDJSON} u.Network = v.Network u.Services = v.Services u.Version = v.Version u.Commit = v.Commit - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if u.PeerID != nil { @@ -8984,21 +9200,31 @@ func (v *NodeInfo) UnmarshalJSON(data []byte) error { v.Services = u.Services v.Version = u.Version v.Commit = u.Commit + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *NodeInfoOptions) UnmarshalJSON(data []byte) error { u := struct { - PeerID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"peerID,omitempty"` + PeerID *encoding.JsonUnmarshalWith[p2p.PeerID] `json:"peerID,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.PeerID = &encoding.JsonUnmarshalWith[p2p.PeerID]{Value: v.PeerID, Func: p2p.UnmarshalPeerIDJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if u.PeerID != nil { v.PeerID = u.PeerID.Value } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -9006,16 +9232,22 @@ func (v *PendingQuery) UnmarshalJSON(data []byte) error { u := struct { QueryType QueryType `json:"queryType"` Range *RangeOptions `json:"range,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() u.Range = v.Range - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.QueryType() == u.QueryType) { return fmt.Errorf("field QueryType: not equal: want %v, got %v", v.QueryType(), u.QueryType) } v.Range = u.Range + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -9023,10 +9255,12 @@ func (v *PublicKeyHashSearchQuery) UnmarshalJSON(data []byte) error { u := struct { QueryType QueryType `json:"queryType"` PublicKeyHash *string `json:"publicKeyHash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() u.PublicKeyHash = encoding.BytesToJSON(v.PublicKeyHash) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.QueryType() == u.QueryType) { @@ -9037,6 +9271,10 @@ func (v *PublicKeyHashSearchQuery) UnmarshalJSON(data []byte) error { } else { v.PublicKeyHash = x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -9045,11 +9283,13 @@ func (v *PublicKeySearchQuery) UnmarshalJSON(data []byte) error { QueryType QueryType `json:"queryType"` PublicKey *string `json:"publicKey,omitempty"` Type protocol.SignatureType `json:"type,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.QueryType = v.QueryType() u.PublicKey = encoding.BytesToJSON(v.PublicKey) u.Type = v.Type - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.QueryType() == u.QueryType) { @@ -9061,6 +9301,10 @@ func (v *PublicKeySearchQuery) UnmarshalJSON(data []byte) error { v.PublicKey = x } v.Type = u.Type + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -9075,6 +9319,7 @@ func (v *Receipt) UnmarshalJSON(data []byte) error { LocalBlock uint64 `json:"localBlock,omitempty"` LocalBlockTime time.Time `json:"localBlockTime,omitempty"` MajorBlock uint64 `json:"majorBlock,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Start = encoding.BytesToJSON(v.Receipt.Start) u.StartIndex = v.Receipt.StartIndex @@ -9085,7 +9330,8 @@ func (v *Receipt) UnmarshalJSON(data []byte) error { u.LocalBlock = v.LocalBlock u.LocalBlockTime = v.LocalBlockTime u.MajorBlock = v.MajorBlock - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if x, err := encoding.BytesFromJSON(u.Start); err != nil { @@ -9109,6 +9355,10 @@ func (v *Receipt) UnmarshalJSON(data []byte) error { v.LocalBlock = u.LocalBlock v.LocalBlockTime = u.LocalBlockTime v.MajorBlock = u.MajorBlock + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -9119,13 +9369,15 @@ func (v *RecordRange[T]) UnmarshalJSON(data []byte) error { Start uint64 `json:"start"` Total uint64 `json:"total"` LastBlockTime *time.Time `json:"lastBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() u.Records = &encoding.JsonUnmarshalListWith[T]{Value: v.Records, Func: func(b []byte) (T, error) { return encoding.Cast[T](UnmarshalRecordJSON(b)) }} u.Start = v.Start u.Total = v.Total u.LastBlockTime = v.LastBlockTime - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.RecordType() == u.RecordType) { @@ -9140,6 +9392,10 @@ func (v *RecordRange[T]) UnmarshalJSON(data []byte) error { v.Start = u.Start v.Total = u.Total v.LastBlockTime = u.LastBlockTime + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -9148,11 +9404,13 @@ func (v *SignatureSetRecord) UnmarshalJSON(data []byte) error { RecordType RecordType `json:"recordType"` Account *encoding.JsonUnmarshalWith[protocol.Account] `json:"account,omitempty"` Signatures *RecordRange[*MessageRecord[messaging.Message]] `json:"signatures,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() u.Account = &encoding.JsonUnmarshalWith[protocol.Account]{Value: v.Account, Func: protocol.UnmarshalAccountJSON} u.Signatures = v.Signatures - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.RecordType() == u.RecordType) { @@ -9163,6 +9421,10 @@ func (v *SignatureSetRecord) UnmarshalJSON(data []byte) error { } v.Signatures = u.Signatures + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -9170,16 +9432,22 @@ func (v *TxIDRecord) UnmarshalJSON(data []byte) error { u := struct { RecordType RecordType `json:"recordType"` Value *url.TxID `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() u.Value = v.Value - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.RecordType() == u.RecordType) { return fmt.Errorf("field RecordType: not equal: want %v, got %v", v.RecordType(), u.RecordType) } v.Value = u.Value + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -9187,15 +9455,21 @@ func (v *UrlRecord) UnmarshalJSON(data []byte) error { u := struct { RecordType RecordType `json:"recordType"` Value *url.URL `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.RecordType = v.RecordType() u.Value = v.Value - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.RecordType() == u.RecordType) { return fmt.Errorf("field RecordType: not equal: want %v, got %v", v.RecordType(), u.RecordType) } v.Value = u.Value + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } diff --git a/pkg/api/v3/websocket/types_gen.go b/pkg/api/v3/websocket/types_gen.go index f754d68f5..5c874d9e4 100644 --- a/pkg/api/v3/websocket/types_gen.go +++ b/pkg/api/v3/websocket/types_gen.go @@ -152,9 +152,10 @@ func (v *Message) UnmarshalBinaryFrom(rd io.Reader) error { func (v *Message) MarshalJSON() ([]byte, error) { u := struct { - ID uint64 `json:"id,omitempty"` - Status StreamStatus `json:"status,omitempty"` - Message *encoding.JsonUnmarshalWith[message.Message] `json:"message,omitempty"` + ID uint64 `json:"id,omitempty"` + Status StreamStatus `json:"status,omitempty"` + Message *encoding.JsonUnmarshalWith[message.Message] `json:"message,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.ID == 0) { u.ID = v.ID @@ -165,19 +166,22 @@ func (v *Message) MarshalJSON() ([]byte, error) { if !(message.Equal(v.Message, nil)) { u.Message = &encoding.JsonUnmarshalWith[message.Message]{Value: v.Message, Func: message.UnmarshalJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *Message) UnmarshalJSON(data []byte) error { u := struct { - ID uint64 `json:"id,omitempty"` - Status StreamStatus `json:"status,omitempty"` - Message *encoding.JsonUnmarshalWith[message.Message] `json:"message,omitempty"` + ID uint64 `json:"id,omitempty"` + Status StreamStatus `json:"status,omitempty"` + Message *encoding.JsonUnmarshalWith[message.Message] `json:"message,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.ID = v.ID u.Status = v.Status u.Message = &encoding.JsonUnmarshalWith[message.Message]{Value: v.Message, Func: message.UnmarshalJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.ID = u.ID @@ -186,5 +190,9 @@ func (v *Message) UnmarshalJSON(data []byte) error { v.Message = u.Message.Value } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } diff --git a/pkg/database/keyvalue/block/types_gen.go b/pkg/database/keyvalue/block/types_gen.go index 5cb04657f..47c1d24de 100644 --- a/pkg/database/keyvalue/block/types_gen.go +++ b/pkg/database/keyvalue/block/types_gen.go @@ -387,17 +387,20 @@ func (v *startBlockEntry) UnmarshalFieldsFrom(reader *encoding.Reader) error { func (v *endBlockEntry) MarshalJSON() ([]byte, error) { u := struct { - Type entryType `json:"type"` + Type entryType `json:"type"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *recordEntry) MarshalJSON() ([]byte, error) { u := struct { - Type entryType `json:"type"` - Key *record.Key `json:"key,omitempty"` - Length int64 `json:"length,omitempty"` + Type entryType `json:"type"` + Key *record.Key `json:"key,omitempty"` + Length int64 `json:"length,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Key == nil) { @@ -406,14 +409,16 @@ func (v *recordEntry) MarshalJSON() ([]byte, error) { if !(v.Length == 0) { u.Length = v.Length } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *startBlockEntry) MarshalJSON() ([]byte, error) { u := struct { - Type entryType `json:"type"` - ID uint64 `json:"id,omitempty"` - Parent uint64 `json:"parent,omitempty"` + Type entryType `json:"type"` + ID uint64 `json:"id,omitempty"` + Parent uint64 `json:"parent,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.ID == 0) { @@ -422,33 +427,42 @@ func (v *startBlockEntry) MarshalJSON() ([]byte, error) { if !(v.Parent == 0) { u.Parent = v.Parent } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *endBlockEntry) UnmarshalJSON(data []byte) error { u := struct { - Type entryType `json:"type"` + Type entryType `json:"type"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *recordEntry) UnmarshalJSON(data []byte) error { u := struct { - Type entryType `json:"type"` - Key *record.Key `json:"key,omitempty"` - Length int64 `json:"length,omitempty"` + Type entryType `json:"type"` + Key *record.Key `json:"key,omitempty"` + Length int64 `json:"length,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Key = v.Key u.Length = v.Length - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -456,19 +470,25 @@ func (v *recordEntry) UnmarshalJSON(data []byte) error { } v.Key = u.Key v.Length = u.Length + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *startBlockEntry) UnmarshalJSON(data []byte) error { u := struct { - Type entryType `json:"type"` - ID uint64 `json:"id,omitempty"` - Parent uint64 `json:"parent,omitempty"` + Type entryType `json:"type"` + ID uint64 `json:"id,omitempty"` + Parent uint64 `json:"parent,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.ID = v.ID u.Parent = v.Parent - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -476,5 +496,9 @@ func (v *startBlockEntry) UnmarshalJSON(data []byte) error { } v.ID = u.ID v.Parent = u.Parent + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } diff --git a/pkg/database/merkle/types_gen.go b/pkg/database/merkle/types_gen.go index f0e08806e..29baa0997 100644 --- a/pkg/database/merkle/types_gen.go +++ b/pkg/database/merkle/types_gen.go @@ -818,6 +818,7 @@ func (v *Receipt) MarshalJSON() ([]byte, error) { EndIndex int64 `json:"endIndex,omitempty"` Anchor *string `json:"anchor,omitempty"` Entries encoding.JsonList[*ReceiptEntry] `json:"entries,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Start) == 0) { u.Start = encoding.BytesToJSON(v.Start) @@ -837,13 +838,15 @@ func (v *Receipt) MarshalJSON() ([]byte, error) { if !(len(v.Entries) == 0) { u.Entries = v.Entries } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *ReceiptEntry) MarshalJSON() ([]byte, error) { u := struct { - Right bool `json:"right,omitempty"` - Hash *string `json:"hash,omitempty"` + Right bool `json:"right,omitempty"` + Hash *string `json:"hash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(!v.Right) { u.Right = v.Right @@ -851,6 +854,7 @@ func (v *ReceiptEntry) MarshalJSON() ([]byte, error) { if !(len(v.Hash) == 0) { u.Hash = encoding.BytesToJSON(v.Hash) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -860,6 +864,7 @@ func (v *ReceiptList) MarshalJSON() ([]byte, error) { Elements encoding.JsonList[*string] `json:"elements,omitempty"` Receipt *Receipt `json:"receipt,omitempty"` ContinuedReceipt *Receipt `json:"continuedReceipt,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.MerkleState == nil) { u.MerkleState = v.MerkleState @@ -876,6 +881,7 @@ func (v *ReceiptList) MarshalJSON() ([]byte, error) { if !(v.ContinuedReceipt == nil) { u.ContinuedReceipt = v.ContinuedReceipt } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -905,9 +911,10 @@ func (v *State) MarshalJSON() ([]byte, error) { func (v *chainIndexBlock) MarshalJSON() ([]byte, error) { u := struct { - Level uint64 `json:"level,omitempty"` - Index uint64 `json:"index,omitempty"` - Entries encoding.JsonList[*chainIndexEntry] `json:"entries,omitempty"` + Level uint64 `json:"level,omitempty"` + Index uint64 `json:"index,omitempty"` + Entries encoding.JsonList[*chainIndexEntry] `json:"entries,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Level == 0) { u.Level = v.Level @@ -918,6 +925,7 @@ func (v *chainIndexBlock) MarshalJSON() ([]byte, error) { if !(len(v.Entries) == 0) { u.Entries = v.Entries } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -929,6 +937,7 @@ func (v *Receipt) UnmarshalJSON(data []byte) error { EndIndex int64 `json:"endIndex,omitempty"` Anchor *string `json:"anchor,omitempty"` Entries encoding.JsonList[*ReceiptEntry] `json:"entries,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Start = encoding.BytesToJSON(v.Start) u.StartIndex = v.StartIndex @@ -936,7 +945,8 @@ func (v *Receipt) UnmarshalJSON(data []byte) error { u.EndIndex = v.EndIndex u.Anchor = encoding.BytesToJSON(v.Anchor) u.Entries = v.Entries - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if x, err := encoding.BytesFromJSON(u.Start); err != nil { @@ -957,17 +967,23 @@ func (v *Receipt) UnmarshalJSON(data []byte) error { v.Anchor = x } v.Entries = u.Entries + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *ReceiptEntry) UnmarshalJSON(data []byte) error { u := struct { - Right bool `json:"right,omitempty"` - Hash *string `json:"hash,omitempty"` + Right bool `json:"right,omitempty"` + Hash *string `json:"hash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Right = v.Right u.Hash = encoding.BytesToJSON(v.Hash) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Right = u.Right @@ -976,6 +992,10 @@ func (v *ReceiptEntry) UnmarshalJSON(data []byte) error { } else { v.Hash = x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -985,6 +1005,7 @@ func (v *ReceiptList) UnmarshalJSON(data []byte) error { Elements encoding.JsonList[*string] `json:"elements,omitempty"` Receipt *Receipt `json:"receipt,omitempty"` ContinuedReceipt *Receipt `json:"continuedReceipt,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.MerkleState = v.MerkleState u.Elements = make(encoding.JsonList[*string], len(v.Elements)) @@ -993,7 +1014,8 @@ func (v *ReceiptList) UnmarshalJSON(data []byte) error { } u.Receipt = v.Receipt u.ContinuedReceipt = v.ContinuedReceipt - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.MerkleState = u.MerkleState @@ -1007,6 +1029,10 @@ func (v *ReceiptList) UnmarshalJSON(data []byte) error { } v.Receipt = u.Receipt v.ContinuedReceipt = u.ContinuedReceipt + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -1025,7 +1051,8 @@ func (v *State) UnmarshalJSON(data []byte) error { for i, x := range v.HashList { u.HashList[i] = encoding.BytesToJSON(x) } - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Count = u.Count @@ -1050,18 +1077,24 @@ func (v *State) UnmarshalJSON(data []byte) error { func (v *chainIndexBlock) UnmarshalJSON(data []byte) error { u := struct { - Level uint64 `json:"level,omitempty"` - Index uint64 `json:"index,omitempty"` - Entries encoding.JsonList[*chainIndexEntry] `json:"entries,omitempty"` + Level uint64 `json:"level,omitempty"` + Index uint64 `json:"index,omitempty"` + Entries encoding.JsonList[*chainIndexEntry] `json:"entries,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Level = v.Level u.Index = v.Index u.Entries = v.Entries - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Level = u.Level v.Index = u.Index v.Entries = u.Entries + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } diff --git a/pkg/database/snapshot/types_gen.go b/pkg/database/snapshot/types_gen.go index edf90723a..d1370f224 100644 --- a/pkg/database/snapshot/types_gen.go +++ b/pkg/database/snapshot/types_gen.go @@ -404,6 +404,7 @@ func (v *Header) MarshalJSON() ([]byte, error) { Version uint64 `json:"version,omitempty"` RootHash *string `json:"rootHash,omitempty"` SystemLedger *protocol.SystemLedger `json:"systemLedger,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Version == 0) { u.Version = v.Version @@ -414,14 +415,16 @@ func (v *Header) MarshalJSON() ([]byte, error) { if !(v.SystemLedger == nil) { u.SystemLedger = v.SystemLedger } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *RecordEntry) MarshalJSON() ([]byte, error) { u := struct { - Key *record.Key `json:"key,omitempty"` - Value *string `json:"value,omitempty"` - Receipt *merkle.Receipt `json:"receipt,omitempty"` + Key *record.Key `json:"key,omitempty"` + Value *string `json:"value,omitempty"` + Receipt *merkle.Receipt `json:"receipt,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Key == nil) { u.Key = v.Key @@ -432,6 +435,7 @@ func (v *RecordEntry) MarshalJSON() ([]byte, error) { if !(v.Receipt == nil) { u.Receipt = v.Receipt } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -440,11 +444,13 @@ func (v *Header) UnmarshalJSON(data []byte) error { Version uint64 `json:"version,omitempty"` RootHash *string `json:"rootHash,omitempty"` SystemLedger *protocol.SystemLedger `json:"systemLedger,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Version = v.Version u.RootHash = encoding.ChainToJSON(&v.RootHash) u.SystemLedger = v.SystemLedger - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Version = u.Version @@ -454,19 +460,25 @@ func (v *Header) UnmarshalJSON(data []byte) error { v.RootHash = *x } v.SystemLedger = u.SystemLedger + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *RecordEntry) UnmarshalJSON(data []byte) error { u := struct { - Key *record.Key `json:"key,omitempty"` - Value *string `json:"value,omitempty"` - Receipt *merkle.Receipt `json:"receipt,omitempty"` + Key *record.Key `json:"key,omitempty"` + Value *string `json:"value,omitempty"` + Receipt *merkle.Receipt `json:"receipt,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Key = v.Key u.Value = encoding.BytesToJSON(v.Value) u.Receipt = v.Receipt - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Key = u.Key @@ -476,5 +488,9 @@ func (v *RecordEntry) UnmarshalJSON(data []byte) error { v.Value = x } v.Receipt = u.Receipt + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } diff --git a/pkg/errors/types_gen.go b/pkg/errors/types_gen.go index ff99abd86..2e7b448cb 100644 --- a/pkg/errors/types_gen.go +++ b/pkg/errors/types_gen.go @@ -342,6 +342,7 @@ func (v *ErrorBase[Status]) MarshalJSON() ([]byte, error) { Cause *ErrorBase[Status] `json:"cause,omitempty"` CallStack encoding.JsonList[*CallSite] `json:"callStack,omitempty"` Data json.RawMessage `json:"data,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Message) == 0) { u.Message = v.Message @@ -361,6 +362,7 @@ func (v *ErrorBase[Status]) MarshalJSON() ([]byte, error) { if !(len(v.Data) == 0) { u.Data = v.Data } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -372,6 +374,7 @@ func (v *ErrorBase[Status]) UnmarshalJSON(data []byte) error { Cause *ErrorBase[Status] `json:"cause,omitempty"` CallStack encoding.JsonList[*CallSite] `json:"callStack,omitempty"` Data json.RawMessage `json:"data,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Message = v.Message u.Code = v.Code @@ -379,7 +382,8 @@ func (v *ErrorBase[Status]) UnmarshalJSON(data []byte) error { u.Cause = v.Cause u.CallStack = v.CallStack u.Data = v.Data - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Message = u.Message @@ -387,5 +391,9 @@ func (v *ErrorBase[Status]) UnmarshalJSON(data []byte) error { v.Cause = u.Cause v.CallStack = u.CallStack v.Data = u.Data + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } diff --git a/pkg/proxy/types_gen.go b/pkg/proxy/types_gen.go index b6a82e033..6244ebb62 100644 --- a/pkg/proxy/types_gen.go +++ b/pkg/proxy/types_gen.go @@ -786,10 +786,12 @@ func (v *NetworkConfigResponse) MarshalJSON() ([]byte, error) { func (v *PartitionList) MarshalJSON() ([]byte, error) { u := struct { Partitions encoding.JsonList[string] `json:"partitions,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Partitions) == 0) { u.Partitions = v.Partitions } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -799,7 +801,6 @@ func (v *PartitionListResponse) MarshalJSON() ([]byte, error) { Signature *encoding.JsonUnmarshalWith[protocol.KeySignature] `json:"signature,omitempty"` }{} if !(len(v.PartitionList.Partitions) == 0) { - u.Partitions = v.PartitionList.Partitions } if !(protocol.EqualKeySignature(v.Signature, nil)) { @@ -814,7 +815,6 @@ func (v *SeedCountResponse) MarshalJSON() ([]byte, error) { Signature *encoding.JsonUnmarshalWith[protocol.KeySignature] `json:"signature,omitempty"` }{} if !(v.SeedCount.Count == 0) { - u.Count = v.SeedCount.Count } if !(protocol.EqualKeySignature(v.Signature, nil)) { @@ -828,6 +828,7 @@ func (v *SeedList) MarshalJSON() ([]byte, error) { BasePort uint64 `json:"basePort,omitempty"` Type protocol.PartitionType `json:"type,omitempty"` Addresses encoding.JsonList[string] `json:"addresses,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.BasePort == 0) { u.BasePort = v.BasePort @@ -838,6 +839,7 @@ func (v *SeedList) MarshalJSON() ([]byte, error) { if !(len(v.Addresses) == 0) { u.Addresses = v.Addresses } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -849,15 +851,12 @@ func (v *SeedListResponse) MarshalJSON() ([]byte, error) { Signature *encoding.JsonUnmarshalWith[protocol.KeySignature] `json:"signature,omitempty"` }{} if !(v.SeedList.BasePort == 0) { - u.BasePort = v.SeedList.BasePort } if !(v.SeedList.Type == 0) { - u.Type = v.SeedList.Type } if !(len(v.SeedList.Addresses) == 0) { - u.Addresses = v.SeedList.Addresses } if !(protocol.EqualKeySignature(v.Signature, nil)) { @@ -873,7 +872,8 @@ func (v *NetworkConfigResponse) UnmarshalJSON(data []byte) error { }{} u.NetworkState = v.NetworkState u.Signature = &encoding.JsonUnmarshalWith[protocol.KeySignature]{Value: v.Signature, Func: protocol.UnmarshalKeySignatureJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.NetworkState = u.NetworkState @@ -887,12 +887,18 @@ func (v *NetworkConfigResponse) UnmarshalJSON(data []byte) error { func (v *PartitionList) UnmarshalJSON(data []byte) error { u := struct { Partitions encoding.JsonList[string] `json:"partitions,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Partitions = v.Partitions - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Partitions = u.Partitions + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -903,7 +909,8 @@ func (v *PartitionListResponse) UnmarshalJSON(data []byte) error { }{} u.Partitions = v.PartitionList.Partitions u.Signature = &encoding.JsonUnmarshalWith[protocol.KeySignature]{Value: v.Signature, Func: protocol.UnmarshalKeySignatureJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.PartitionList.Partitions = u.Partitions @@ -921,7 +928,8 @@ func (v *SeedCountResponse) UnmarshalJSON(data []byte) error { }{} u.Count = v.SeedCount.Count u.Signature = &encoding.JsonUnmarshalWith[protocol.KeySignature]{Value: v.Signature, Func: protocol.UnmarshalKeySignatureJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.SeedCount.Count = u.Count @@ -937,16 +945,22 @@ func (v *SeedList) UnmarshalJSON(data []byte) error { BasePort uint64 `json:"basePort,omitempty"` Type protocol.PartitionType `json:"type,omitempty"` Addresses encoding.JsonList[string] `json:"addresses,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.BasePort = v.BasePort u.Type = v.Type u.Addresses = v.Addresses - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.BasePort = u.BasePort v.Type = u.Type v.Addresses = u.Addresses + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -961,7 +975,8 @@ func (v *SeedListResponse) UnmarshalJSON(data []byte) error { u.Type = v.SeedList.Type u.Addresses = v.SeedList.Addresses u.Signature = &encoding.JsonUnmarshalWith[protocol.KeySignature]{Value: v.Signature, Func: protocol.UnmarshalKeySignatureJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.SeedList.BasePort = u.BasePort diff --git a/pkg/types/messaging/types_gen.go b/pkg/types/messaging/types_gen.go index dda649190..5af7a1220 100644 --- a/pkg/types/messaging/types_gen.go +++ b/pkg/types/messaging/types_gen.go @@ -2428,6 +2428,7 @@ func (v *BadSyntheticMessage) MarshalJSON() ([]byte, error) { Message *encoding.JsonUnmarshalWith[Message] `json:"message,omitempty"` Signature *encoding.JsonUnmarshalWith[protocol.KeySignature] `json:"signature,omitempty"` Proof *protocol.AnnotatedReceipt `json:"proof,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(EqualMessage(v.Message, nil)) { @@ -2439,6 +2440,7 @@ func (v *BadSyntheticMessage) MarshalJSON() ([]byte, error) { if !(v.Proof == nil) { u.Proof = v.Proof } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2447,6 +2449,7 @@ func (v *BlockAnchor) MarshalJSON() ([]byte, error) { Type MessageType `json:"type"` Signature *encoding.JsonUnmarshalWith[protocol.KeySignature] `json:"signature,omitempty"` Anchor *encoding.JsonUnmarshalWith[Message] `json:"anchor,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(protocol.EqualKeySignature(v.Signature, nil)) { @@ -2455,6 +2458,7 @@ func (v *BlockAnchor) MarshalJSON() ([]byte, error) { if !(EqualMessage(v.Anchor, nil)) { u.Anchor = &encoding.JsonUnmarshalWith[Message]{Value: v.Anchor, Func: UnmarshalMessageJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2467,6 +2471,7 @@ func (v *BlockSummary) MarshalJSON() ([]byte, error) { PreviousBlock uint64 `json:"previousBlock,omitempty"` RecordUpdates encoding.JsonList[*RecordUpdate] `json:"recordUpdates,omitempty"` StateTreeUpdates encoding.JsonList[*StateTreeUpdate] `json:"stateTreeUpdates,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.Partition) == 0) { @@ -2487,6 +2492,7 @@ func (v *BlockSummary) MarshalJSON() ([]byte, error) { if !(len(v.StateTreeUpdates) == 0) { u.StateTreeUpdates = v.StateTreeUpdates } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2498,6 +2504,7 @@ func (v *CreditPayment) MarshalJSON() ([]byte, error) { Initiator bool `json:"initiator,omitempty"` TxID *url.TxID `json:"txID,omitempty"` Cause *url.TxID `json:"cause,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Paid == 0) { @@ -2515,6 +2522,7 @@ func (v *CreditPayment) MarshalJSON() ([]byte, error) { if !(v.Cause == nil) { u.Cause = v.Cause } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2523,6 +2531,7 @@ func (v *DidUpdateExecutorVersion) MarshalJSON() ([]byte, error) { Type MessageType `json:"type"` Partition string `json:"partition,omitempty"` Version protocol.ExecutorVersion `json:"version,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.Partition) == 0) { @@ -2531,6 +2540,7 @@ func (v *DidUpdateExecutorVersion) MarshalJSON() ([]byte, error) { if !(v.Version == 0) { u.Version = v.Version } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2540,6 +2550,7 @@ func (v *Envelope) MarshalJSON() ([]byte, error) { TxHash *string `json:"txHash,omitempty"` Transaction encoding.JsonList[*protocol.Transaction] `json:"transaction,omitempty"` Messages *encoding.JsonUnmarshalListWith[Message] `json:"messages,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Signatures) == 0) { u.Signatures = &encoding.JsonUnmarshalListWith[protocol.Signature]{Value: v.Signatures, Func: protocol.UnmarshalSignatureJSON} @@ -2553,6 +2564,7 @@ func (v *Envelope) MarshalJSON() ([]byte, error) { if !(len(v.Messages) == 0) { u.Messages = &encoding.JsonUnmarshalListWith[Message]{Value: v.Messages, Func: UnmarshalMessageJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2562,6 +2574,7 @@ func (v *MakeMajorBlock) MarshalJSON() ([]byte, error) { MajorBlockIndex uint64 `json:"majorBlockIndex,omitempty"` MinorBlockIndex uint64 `json:"minorBlockIndex,omitempty"` MajorBlockTime time.Time `json:"majorBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.MajorBlockIndex == 0) { @@ -2573,25 +2586,29 @@ func (v *MakeMajorBlock) MarshalJSON() ([]byte, error) { if !(v.MajorBlockTime == (time.Time{})) { u.MajorBlockTime = v.MajorBlockTime } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *NetworkUpdate) MarshalJSON() ([]byte, error) { u := struct { - Type MessageType `json:"type"` - Accounts encoding.JsonList[*protocol.NetworkAccountUpdate] `json:"accounts,omitempty"` + Type MessageType `json:"type"` + Accounts encoding.JsonList[*protocol.NetworkAccountUpdate] `json:"accounts,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.Accounts) == 0) { u.Accounts = v.Accounts } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *RecordUpdate) MarshalJSON() ([]byte, error) { u := struct { - Key *record.Key `json:"key,omitempty"` - Value *string `json:"value,omitempty"` + Key *record.Key `json:"key,omitempty"` + Value *string `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Key == nil) { u.Key = v.Key @@ -2599,6 +2616,7 @@ func (v *RecordUpdate) MarshalJSON() ([]byte, error) { if !(len(v.Value) == 0) { u.Value = encoding.BytesToJSON(v.Value) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2609,6 +2627,7 @@ func (v *SequencedMessage) MarshalJSON() ([]byte, error) { Source *url.URL `json:"source,omitempty"` Destination *url.URL `json:"destination,omitempty"` Number uint64 `json:"number,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(EqualMessage(v.Message, nil)) { @@ -2623,6 +2642,7 @@ func (v *SequencedMessage) MarshalJSON() ([]byte, error) { if !(v.Number == 0) { u.Number = v.Number } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2631,6 +2651,7 @@ func (v *SignatureMessage) MarshalJSON() ([]byte, error) { Type MessageType `json:"type"` Signature *encoding.JsonUnmarshalWith[protocol.Signature] `json:"signature,omitempty"` TxID *url.TxID `json:"txID,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(protocol.EqualSignature(v.Signature, nil)) { @@ -2639,6 +2660,7 @@ func (v *SignatureMessage) MarshalJSON() ([]byte, error) { if !(v.TxID == nil) { u.TxID = v.TxID } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2648,6 +2670,7 @@ func (v *SignatureRequest) MarshalJSON() ([]byte, error) { Authority *url.URL `json:"authority,omitempty"` TxID *url.TxID `json:"txID,omitempty"` Cause *url.TxID `json:"cause,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Authority == nil) { @@ -2659,13 +2682,15 @@ func (v *SignatureRequest) MarshalJSON() ([]byte, error) { if !(v.Cause == nil) { u.Cause = v.Cause } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *StateTreeUpdate) MarshalJSON() ([]byte, error) { u := struct { - Key *record.Key `json:"key,omitempty"` - Hash *string `json:"hash,omitempty"` + Key *record.Key `json:"key,omitempty"` + Hash *string `json:"hash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Key == nil) { u.Key = v.Key @@ -2673,6 +2698,7 @@ func (v *StateTreeUpdate) MarshalJSON() ([]byte, error) { if !(v.Hash == ([32]byte{})) { u.Hash = encoding.ChainToJSON(&v.Hash) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2700,6 +2726,7 @@ func (v *SyntheticMessage) MarshalJSON() ([]byte, error) { Message *encoding.JsonUnmarshalWith[Message] `json:"message,omitempty"` Signature *encoding.JsonUnmarshalWith[protocol.KeySignature] `json:"signature,omitempty"` Proof *protocol.AnnotatedReceipt `json:"proof,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(EqualMessage(v.Message, nil)) { @@ -2711,6 +2738,7 @@ func (v *SyntheticMessage) MarshalJSON() ([]byte, error) { if !(v.Proof == nil) { u.Proof = v.Proof } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2718,11 +2746,13 @@ func (v *TransactionMessage) MarshalJSON() ([]byte, error) { u := struct { Type MessageType `json:"type"` Transaction *protocol.Transaction `json:"transaction,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Transaction == nil) { u.Transaction = v.Transaction } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2732,12 +2762,14 @@ func (v *BadSyntheticMessage) UnmarshalJSON(data []byte) error { Message *encoding.JsonUnmarshalWith[Message] `json:"message,omitempty"` Signature *encoding.JsonUnmarshalWith[protocol.KeySignature] `json:"signature,omitempty"` Proof *protocol.AnnotatedReceipt `json:"proof,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Message = &encoding.JsonUnmarshalWith[Message]{Value: v.Message, Func: UnmarshalMessageJSON} u.Signature = &encoding.JsonUnmarshalWith[protocol.KeySignature]{Value: v.Signature, Func: protocol.UnmarshalKeySignatureJSON} u.Proof = v.Proof - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2752,6 +2784,10 @@ func (v *BadSyntheticMessage) UnmarshalJSON(data []byte) error { } v.Proof = u.Proof + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -2760,11 +2796,13 @@ func (v *BlockAnchor) UnmarshalJSON(data []byte) error { Type MessageType `json:"type"` Signature *encoding.JsonUnmarshalWith[protocol.KeySignature] `json:"signature,omitempty"` Anchor *encoding.JsonUnmarshalWith[Message] `json:"anchor,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Signature = &encoding.JsonUnmarshalWith[protocol.KeySignature]{Value: v.Signature, Func: protocol.UnmarshalKeySignatureJSON} u.Anchor = &encoding.JsonUnmarshalWith[Message]{Value: v.Anchor, Func: UnmarshalMessageJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2778,6 +2816,10 @@ func (v *BlockAnchor) UnmarshalJSON(data []byte) error { v.Anchor = u.Anchor.Value } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -2790,6 +2832,7 @@ func (v *BlockSummary) UnmarshalJSON(data []byte) error { PreviousBlock uint64 `json:"previousBlock,omitempty"` RecordUpdates encoding.JsonList[*RecordUpdate] `json:"recordUpdates,omitempty"` StateTreeUpdates encoding.JsonList[*StateTreeUpdate] `json:"stateTreeUpdates,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Partition = v.Partition @@ -2798,7 +2841,8 @@ func (v *BlockSummary) UnmarshalJSON(data []byte) error { u.PreviousBlock = v.PreviousBlock u.RecordUpdates = v.RecordUpdates u.StateTreeUpdates = v.StateTreeUpdates - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2814,6 +2858,10 @@ func (v *BlockSummary) UnmarshalJSON(data []byte) error { v.PreviousBlock = u.PreviousBlock v.RecordUpdates = u.RecordUpdates v.StateTreeUpdates = u.StateTreeUpdates + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -2825,6 +2873,7 @@ func (v *CreditPayment) UnmarshalJSON(data []byte) error { Initiator bool `json:"initiator,omitempty"` TxID *url.TxID `json:"txID,omitempty"` Cause *url.TxID `json:"cause,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Paid = v.Paid @@ -2832,7 +2881,8 @@ func (v *CreditPayment) UnmarshalJSON(data []byte) error { u.Initiator = v.Initiator u.TxID = v.TxID u.Cause = v.Cause - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2843,6 +2893,10 @@ func (v *CreditPayment) UnmarshalJSON(data []byte) error { v.Initiator = u.Initiator v.TxID = u.TxID v.Cause = u.Cause + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -2851,11 +2905,13 @@ func (v *DidUpdateExecutorVersion) UnmarshalJSON(data []byte) error { Type MessageType `json:"type"` Partition string `json:"partition,omitempty"` Version protocol.ExecutorVersion `json:"version,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Partition = v.Partition u.Version = v.Version - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2863,6 +2919,10 @@ func (v *DidUpdateExecutorVersion) UnmarshalJSON(data []byte) error { } v.Partition = u.Partition v.Version = u.Version + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -2872,12 +2932,14 @@ func (v *Envelope) UnmarshalJSON(data []byte) error { TxHash *string `json:"txHash,omitempty"` Transaction encoding.JsonList[*protocol.Transaction] `json:"transaction,omitempty"` Messages *encoding.JsonUnmarshalListWith[Message] `json:"messages,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Signatures = &encoding.JsonUnmarshalListWith[protocol.Signature]{Value: v.Signatures, Func: protocol.UnmarshalSignatureJSON} u.TxHash = encoding.BytesToJSON(v.TxHash) u.Transaction = v.Transaction u.Messages = &encoding.JsonUnmarshalListWith[Message]{Value: v.Messages, Func: UnmarshalMessageJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if u.Signatures != nil { @@ -2898,6 +2960,10 @@ func (v *Envelope) UnmarshalJSON(data []byte) error { v.Messages[i] = x } } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -2907,12 +2973,14 @@ func (v *MakeMajorBlock) UnmarshalJSON(data []byte) error { MajorBlockIndex uint64 `json:"majorBlockIndex,omitempty"` MinorBlockIndex uint64 `json:"minorBlockIndex,omitempty"` MajorBlockTime time.Time `json:"majorBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.MajorBlockIndex = v.MajorBlockIndex u.MinorBlockIndex = v.MinorBlockIndex u.MajorBlockTime = v.MajorBlockTime - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2921,34 +2989,46 @@ func (v *MakeMajorBlock) UnmarshalJSON(data []byte) error { v.MajorBlockIndex = u.MajorBlockIndex v.MinorBlockIndex = u.MinorBlockIndex v.MajorBlockTime = u.MajorBlockTime + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *NetworkUpdate) UnmarshalJSON(data []byte) error { u := struct { - Type MessageType `json:"type"` - Accounts encoding.JsonList[*protocol.NetworkAccountUpdate] `json:"accounts,omitempty"` + Type MessageType `json:"type"` + Accounts encoding.JsonList[*protocol.NetworkAccountUpdate] `json:"accounts,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Accounts = v.Accounts - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Accounts = u.Accounts + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *RecordUpdate) UnmarshalJSON(data []byte) error { u := struct { - Key *record.Key `json:"key,omitempty"` - Value *string `json:"value,omitempty"` + Key *record.Key `json:"key,omitempty"` + Value *string `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Key = v.Key u.Value = encoding.BytesToJSON(v.Value) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Key = u.Key @@ -2957,6 +3037,10 @@ func (v *RecordUpdate) UnmarshalJSON(data []byte) error { } else { v.Value = x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -2967,13 +3051,15 @@ func (v *SequencedMessage) UnmarshalJSON(data []byte) error { Source *url.URL `json:"source,omitempty"` Destination *url.URL `json:"destination,omitempty"` Number uint64 `json:"number,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Message = &encoding.JsonUnmarshalWith[Message]{Value: v.Message, Func: UnmarshalMessageJSON} u.Source = v.Source u.Destination = v.Destination u.Number = v.Number - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2986,6 +3072,10 @@ func (v *SequencedMessage) UnmarshalJSON(data []byte) error { v.Source = u.Source v.Destination = u.Destination v.Number = u.Number + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -2994,11 +3084,13 @@ func (v *SignatureMessage) UnmarshalJSON(data []byte) error { Type MessageType `json:"type"` Signature *encoding.JsonUnmarshalWith[protocol.Signature] `json:"signature,omitempty"` TxID *url.TxID `json:"txID,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Signature = &encoding.JsonUnmarshalWith[protocol.Signature]{Value: v.Signature, Func: protocol.UnmarshalSignatureJSON} u.TxID = v.TxID - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3009,6 +3101,10 @@ func (v *SignatureMessage) UnmarshalJSON(data []byte) error { } v.TxID = u.TxID + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -3018,12 +3114,14 @@ func (v *SignatureRequest) UnmarshalJSON(data []byte) error { Authority *url.URL `json:"authority,omitempty"` TxID *url.TxID `json:"txID,omitempty"` Cause *url.TxID `json:"cause,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Authority = v.Authority u.TxID = v.TxID u.Cause = v.Cause - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3032,17 +3130,23 @@ func (v *SignatureRequest) UnmarshalJSON(data []byte) error { v.Authority = u.Authority v.TxID = u.TxID v.Cause = u.Cause + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *StateTreeUpdate) UnmarshalJSON(data []byte) error { u := struct { - Key *record.Key `json:"key,omitempty"` - Hash *string `json:"hash,omitempty"` + Key *record.Key `json:"key,omitempty"` + Hash *string `json:"hash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Key = v.Key u.Hash = encoding.ChainToJSON(&v.Hash) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Key = u.Key @@ -3051,6 +3155,10 @@ func (v *StateTreeUpdate) UnmarshalJSON(data []byte) error { } else { v.Hash = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -3063,7 +3171,8 @@ func (v *SynthFields) UnmarshalJSON(data []byte) error { u.Message = &encoding.JsonUnmarshalWith[Message]{Value: v.Message, Func: UnmarshalMessageJSON} u.Signature = &encoding.JsonUnmarshalWith[protocol.KeySignature]{Value: v.Signature, Func: protocol.UnmarshalKeySignatureJSON} u.Proof = v.Proof - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if u.Message != nil { @@ -3084,12 +3193,14 @@ func (v *SyntheticMessage) UnmarshalJSON(data []byte) error { Message *encoding.JsonUnmarshalWith[Message] `json:"message,omitempty"` Signature *encoding.JsonUnmarshalWith[protocol.KeySignature] `json:"signature,omitempty"` Proof *protocol.AnnotatedReceipt `json:"proof,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Message = &encoding.JsonUnmarshalWith[Message]{Value: v.Message, Func: UnmarshalMessageJSON} u.Signature = &encoding.JsonUnmarshalWith[protocol.KeySignature]{Value: v.Signature, Func: protocol.UnmarshalKeySignatureJSON} u.Proof = v.Proof - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -3104,6 +3215,10 @@ func (v *SyntheticMessage) UnmarshalJSON(data []byte) error { } v.Proof = u.Proof + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -3111,15 +3226,21 @@ func (v *TransactionMessage) UnmarshalJSON(data []byte) error { u := struct { Type MessageType `json:"type"` Transaction *protocol.Transaction `json:"transaction,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Transaction = v.Transaction - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Transaction = u.Transaction + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } diff --git a/protocol/types_gen.go b/protocol/types_gen.go index f8429b20d..cc7689063 100644 --- a/protocol/types_gen.go +++ b/protocol/types_gen.go @@ -18192,32 +18192,36 @@ func (v *ADI) MarshalJSON() ([]byte, error) { Type AccountType `json:"type"` Url *url.URL `json:"url,omitempty"` Authorities encoding.JsonList[AuthorityEntry] `json:"authorities,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { u.Url = v.Url } if !(len(v.AccountAuth.Authorities) == 0) { - u.Authorities = v.AccountAuth.Authorities } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *AccountAuth) MarshalJSON() ([]byte, error) { u := struct { Authorities encoding.JsonList[AuthorityEntry] `json:"authorities,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Authorities) == 0) { u.Authorities = v.Authorities } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *AccumulateDataEntry) MarshalJSON() ([]byte, error) { u := struct { - Type DataEntryType `json:"type"` - Data encoding.JsonList[*string] `json:"data,omitempty"` + Type DataEntryType `json:"type"` + Data encoding.JsonList[*string] `json:"data,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.Data) == 0) { @@ -18226,30 +18230,35 @@ func (v *AccumulateDataEntry) MarshalJSON() ([]byte, error) { u.Data[i] = encoding.BytesToJSON(x) } } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *AcmeFaucet) MarshalJSON() ([]byte, error) { u := struct { - Type TransactionType `json:"type"` - Url *url.URL `json:"url,omitempty"` + Type TransactionType `json:"type"` + Url *url.URL `json:"url,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { u.Url = v.Url } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *ActivateProtocolVersion) MarshalJSON() ([]byte, error) { u := struct { - Type TransactionType `json:"type"` - Version ExecutorVersion `json:"version,omitempty"` + Type TransactionType `json:"type"` + Version ExecutorVersion `json:"version,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Version == 0) { u.Version = v.Version } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18257,11 +18266,13 @@ func (v *AddAccountAuthorityOperation) MarshalJSON() ([]byte, error) { u := struct { Type AccountAuthOperationType `json:"type"` Authority *url.URL `json:"authority,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Authority == nil) { u.Authority = v.Authority } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18271,6 +18282,7 @@ func (v *AddCredits) MarshalJSON() ([]byte, error) { Recipient *url.URL `json:"recipient,omitempty"` Amount *string `json:"amount,omitempty"` Oracle uint64 `json:"oracle,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Recipient == nil) { @@ -18282,15 +18294,17 @@ func (v *AddCredits) MarshalJSON() ([]byte, error) { if !(v.Oracle == 0) { u.Oracle = v.Oracle } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *AddCreditsResult) MarshalJSON() ([]byte, error) { u := struct { - Type TransactionType `json:"type"` - Amount *string `json:"amount,omitempty"` - Credits uint64 `json:"credits,omitempty"` - Oracle uint64 `json:"oracle,omitempty"` + Type TransactionType `json:"type"` + Amount *string `json:"amount,omitempty"` + Credits uint64 `json:"credits,omitempty"` + Oracle uint64 `json:"oracle,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !((v.Amount).Cmp(new(big.Int)) == 0) { @@ -18302,18 +18316,21 @@ func (v *AddCreditsResult) MarshalJSON() ([]byte, error) { if !(v.Oracle == 0) { u.Oracle = v.Oracle } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *AddKeyOperation) MarshalJSON() ([]byte, error) { u := struct { - Type KeyPageOperationType `json:"type"` - Entry KeySpecParams `json:"entry,omitempty"` + Type KeyPageOperationType `json:"type"` + Entry KeySpecParams `json:"entry,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !((v.Entry).Equal(new(KeySpecParams))) { u.Entry = v.Entry } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18326,6 +18343,7 @@ func (v *AnchorLedger) MarshalJSON() ([]byte, error) { MajorBlockTime time.Time `json:"majorBlockTime,omitempty"` PendingMajorBlockAnchors encoding.JsonList[*url.URL] `json:"pendingMajorBlockAnchors,omitempty"` Sequence encoding.JsonList[*PartitionSyntheticLedger] `json:"sequence,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { @@ -18346,6 +18364,7 @@ func (v *AnchorLedger) MarshalJSON() ([]byte, error) { if !(len(v.Sequence) == 0) { u.Sequence = v.Sequence } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18358,13 +18377,12 @@ func (v *AnchorMetadata) MarshalJSON() ([]byte, error) { SourceIndex uint64 `json:"sourceIndex,omitempty"` SourceBlock uint64 `json:"sourceBlock,omitempty"` Entry *string `json:"entry,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.ChainMetadata.Name) == 0) { - u.Name = v.ChainMetadata.Name } if !(v.ChainMetadata.Type == 0) { - u.Type = v.ChainMetadata.Type } if !(v.Account == nil) { @@ -18382,6 +18400,7 @@ func (v *AnchorMetadata) MarshalJSON() ([]byte, error) { if !(len(v.Entry) == 0) { u.Entry = encoding.BytesToJSON(v.Entry) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18395,6 +18414,7 @@ func (v *AuthoritySignature) MarshalJSON() ([]byte, error) { Cause *url.TxID `json:"cause,omitempty"` Delegator encoding.JsonList[*url.URL] `json:"delegator,omitempty"` Memo string `json:"memo,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Origin == nil) { @@ -18418,6 +18438,7 @@ func (v *AuthoritySignature) MarshalJSON() ([]byte, error) { if !(len(v.Memo) == 0) { u.Memo = v.Memo } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18433,6 +18454,7 @@ func (v *BTCLegacySignature) MarshalJSON() ([]byte, error) { TransactionHash *string `json:"transactionHash,omitempty"` Memo string `json:"memo,omitempty"` Data *string `json:"data,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.PublicKey) == 0) { @@ -18462,6 +18484,7 @@ func (v *BTCLegacySignature) MarshalJSON() ([]byte, error) { if !(len(v.Data) == 0) { u.Data = encoding.BytesToJSON(v.Data) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18477,6 +18500,7 @@ func (v *BTCSignature) MarshalJSON() ([]byte, error) { TransactionHash *string `json:"transactionHash,omitempty"` Memo string `json:"memo,omitempty"` Data *string `json:"data,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.PublicKey) == 0) { @@ -18506,16 +18530,18 @@ func (v *BTCSignature) MarshalJSON() ([]byte, error) { if !(len(v.Data) == 0) { u.Data = encoding.BytesToJSON(v.Data) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *BlockLedger) MarshalJSON() ([]byte, error) { u := struct { - Type AccountType `json:"type"` - Url *url.URL `json:"url,omitempty"` - Index uint64 `json:"index,omitempty"` - Time time.Time `json:"time,omitempty"` - Entries encoding.JsonList[*BlockEntry] `json:"entries,omitempty"` + Type AccountType `json:"type"` + Url *url.URL `json:"url,omitempty"` + Index uint64 `json:"index,omitempty"` + Time time.Time `json:"time,omitempty"` + Entries encoding.JsonList[*BlockEntry] `json:"entries,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { @@ -18530,6 +18556,7 @@ func (v *BlockLedger) MarshalJSON() ([]byte, error) { if !(len(v.Entries) == 0) { u.Entries = v.Entries } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18543,66 +18570,67 @@ func (v *BlockValidatorAnchor) MarshalJSON() ([]byte, error) { RootChainAnchor *string `json:"rootChainAnchor,omitempty"` StateTreeAnchor *string `json:"stateTreeAnchor,omitempty"` AcmeBurnt *string `json:"acmeBurnt,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.PartitionAnchor.Source == nil) { - u.Source = v.PartitionAnchor.Source } if !(v.PartitionAnchor.MajorBlockIndex == 0) { - u.MajorBlockIndex = v.PartitionAnchor.MajorBlockIndex } if !(v.PartitionAnchor.MinorBlockIndex == 0) { - u.MinorBlockIndex = v.PartitionAnchor.MinorBlockIndex } if !(v.PartitionAnchor.RootChainIndex == 0) { - u.RootChainIndex = v.PartitionAnchor.RootChainIndex } if !(v.PartitionAnchor.RootChainAnchor == ([32]byte{})) { - u.RootChainAnchor = encoding.ChainToJSON(&v.PartitionAnchor.RootChainAnchor) } if !(v.PartitionAnchor.StateTreeAnchor == ([32]byte{})) { - u.StateTreeAnchor = encoding.ChainToJSON(&v.PartitionAnchor.StateTreeAnchor) } if !((v.AcmeBurnt).Cmp(new(big.Int)) == 0) { u.AcmeBurnt = encoding.BigintToJSON(&v.AcmeBurnt) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *BurnCredits) MarshalJSON() ([]byte, error) { u := struct { - Type TransactionType `json:"type"` - Amount uint64 `json:"amount,omitempty"` + Type TransactionType `json:"type"` + Amount uint64 `json:"amount,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Amount == 0) { u.Amount = v.Amount } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *BurnTokens) MarshalJSON() ([]byte, error) { u := struct { - Type TransactionType `json:"type"` - Amount *string `json:"amount,omitempty"` + Type TransactionType `json:"type"` + Amount *string `json:"amount,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !((v.Amount).Cmp(new(big.Int)) == 0) { u.Amount = encoding.BigintToJSON(&v.Amount) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *ChainParams) MarshalJSON() ([]byte, error) { u := struct { - Data *string `json:"data,omitempty"` - IsUpdate bool `json:"isUpdate,omitempty"` + Data *string `json:"data,omitempty"` + IsUpdate bool `json:"isUpdate,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Data) == 0) { u.Data = encoding.BytesToJSON(v.Data) @@ -18610,6 +18638,7 @@ func (v *ChainParams) MarshalJSON() ([]byte, error) { if !(!v.IsUpdate) { u.IsUpdate = v.IsUpdate } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18618,6 +18647,7 @@ func (v *CreateDataAccount) MarshalJSON() ([]byte, error) { Type TransactionType `json:"type"` Url *url.URL `json:"url,omitempty"` Authorities encoding.JsonList[*url.URL] `json:"authorities,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { @@ -18626,6 +18656,7 @@ func (v *CreateDataAccount) MarshalJSON() ([]byte, error) { if !(len(v.Authorities) == 0) { u.Authorities = v.Authorities } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18636,6 +18667,7 @@ func (v *CreateIdentity) MarshalJSON() ([]byte, error) { KeyHash *string `json:"keyHash,omitempty"` KeyBookUrl *url.URL `json:"keyBookUrl,omitempty"` Authorities encoding.JsonList[*url.URL] `json:"authorities,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { @@ -18650,6 +18682,7 @@ func (v *CreateIdentity) MarshalJSON() ([]byte, error) { if !(len(v.Authorities) == 0) { u.Authorities = v.Authorities } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18659,6 +18692,7 @@ func (v *CreateKeyBook) MarshalJSON() ([]byte, error) { Url *url.URL `json:"url,omitempty"` PublicKeyHash *string `json:"publicKeyHash,omitempty"` Authorities encoding.JsonList[*url.URL] `json:"authorities,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { @@ -18670,26 +18704,31 @@ func (v *CreateKeyBook) MarshalJSON() ([]byte, error) { if !(len(v.Authorities) == 0) { u.Authorities = v.Authorities } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *CreateKeyPage) MarshalJSON() ([]byte, error) { u := struct { - Type TransactionType `json:"type"` - Keys encoding.JsonList[*KeySpecParams] `json:"keys,omitempty"` + Type TransactionType `json:"type"` + Keys encoding.JsonList[*KeySpecParams] `json:"keys,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.Keys) == 0) { u.Keys = v.Keys } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *CreateLiteTokenAccount) MarshalJSON() ([]byte, error) { u := struct { - Type TransactionType `json:"type"` + Type TransactionType `json:"type"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18702,6 +18741,7 @@ func (v *CreateToken) MarshalJSON() ([]byte, error) { Properties *url.URL `json:"properties,omitempty"` SupplyLimit *string `json:"supplyLimit,omitempty"` Authorities encoding.JsonList[*url.URL] `json:"authorities,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { @@ -18722,6 +18762,7 @@ func (v *CreateToken) MarshalJSON() ([]byte, error) { if !(len(v.Authorities) == 0) { u.Authorities = v.Authorities } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18732,6 +18773,7 @@ func (v *CreateTokenAccount) MarshalJSON() ([]byte, error) { TokenUrl *url.URL `json:"tokenUrl,omitempty"` Authorities encoding.JsonList[*url.URL] `json:"authorities,omitempty"` Proof *TokenIssuerProof `json:"proof,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { @@ -18746,6 +18788,7 @@ func (v *CreateTokenAccount) MarshalJSON() ([]byte, error) { if !(v.Proof == nil) { u.Proof = v.Proof } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18755,18 +18798,19 @@ func (v *DataAccount) MarshalJSON() ([]byte, error) { Url *url.URL `json:"url,omitempty"` Authorities encoding.JsonList[AuthorityEntry] `json:"authorities,omitempty"` Entry *encoding.JsonUnmarshalWith[DataEntry] `json:"entry,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { u.Url = v.Url } if !(len(v.AccountAuth.Authorities) == 0) { - u.Authorities = v.AccountAuth.Authorities } if !(EqualDataEntry(v.Entry, nil)) { u.Entry = &encoding.JsonUnmarshalWith[DataEntry]{Value: v.Entry, Func: UnmarshalDataEntryJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18775,6 +18819,7 @@ func (v *DelegatedSignature) MarshalJSON() ([]byte, error) { Type SignatureType `json:"type"` Signature *encoding.JsonUnmarshalWith[Signature] `json:"signature,omitempty"` Delegator *url.URL `json:"delegator,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(EqualSignature(v.Signature, nil)) { @@ -18783,6 +18828,7 @@ func (v *DelegatedSignature) MarshalJSON() ([]byte, error) { if !(v.Delegator == nil) { u.Delegator = v.Delegator } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18799,30 +18845,25 @@ func (v *DirectoryAnchor) MarshalJSON() ([]byte, error) { Receipts encoding.JsonList[*PartitionAnchorReceipt] `json:"receipts,omitempty"` MakeMajorBlock uint64 `json:"makeMajorBlock,omitempty"` MakeMajorBlockTime time.Time `json:"makeMajorBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.PartitionAnchor.Source == nil) { - u.Source = v.PartitionAnchor.Source } if !(v.PartitionAnchor.MajorBlockIndex == 0) { - u.MajorBlockIndex = v.PartitionAnchor.MajorBlockIndex } if !(v.PartitionAnchor.MinorBlockIndex == 0) { - u.MinorBlockIndex = v.PartitionAnchor.MinorBlockIndex } if !(v.PartitionAnchor.RootChainIndex == 0) { - u.RootChainIndex = v.PartitionAnchor.RootChainIndex } if !(v.PartitionAnchor.RootChainAnchor == ([32]byte{})) { - u.RootChainAnchor = encoding.ChainToJSON(&v.PartitionAnchor.RootChainAnchor) } if !(v.PartitionAnchor.StateTreeAnchor == ([32]byte{})) { - u.StateTreeAnchor = encoding.ChainToJSON(&v.PartitionAnchor.StateTreeAnchor) } if !(len(v.Updates) == 0) { @@ -18837,6 +18878,7 @@ func (v *DirectoryAnchor) MarshalJSON() ([]byte, error) { if !(v.MakeMajorBlockTime == (time.Time{})) { u.MakeMajorBlockTime = v.MakeMajorBlockTime } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18844,18 +18886,21 @@ func (v *DisableAccountAuthOperation) MarshalJSON() ([]byte, error) { u := struct { Type AccountAuthOperationType `json:"type"` Authority *url.URL `json:"authority,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Authority == nil) { u.Authority = v.Authority } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *DoubleHashDataEntry) MarshalJSON() ([]byte, error) { u := struct { - Type DataEntryType `json:"type"` - Data encoding.JsonList[*string] `json:"data,omitempty"` + Type DataEntryType `json:"type"` + Data encoding.JsonList[*string] `json:"data,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.Data) == 0) { @@ -18864,6 +18909,7 @@ func (v *DoubleHashDataEntry) MarshalJSON() ([]byte, error) { u.Data[i] = encoding.BytesToJSON(x) } } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18879,6 +18925,7 @@ func (v *ED25519Signature) MarshalJSON() ([]byte, error) { TransactionHash *string `json:"transactionHash,omitempty"` Memo string `json:"memo,omitempty"` Data *string `json:"data,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.PublicKey) == 0) { @@ -18908,6 +18955,7 @@ func (v *ED25519Signature) MarshalJSON() ([]byte, error) { if !(len(v.Data) == 0) { u.Data = encoding.BytesToJSON(v.Data) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18923,6 +18971,7 @@ func (v *ETHSignature) MarshalJSON() ([]byte, error) { TransactionHash *string `json:"transactionHash,omitempty"` Memo string `json:"memo,omitempty"` Data *string `json:"data,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.PublicKey) == 0) { @@ -18952,14 +19001,17 @@ func (v *ETHSignature) MarshalJSON() ([]byte, error) { if !(len(v.Data) == 0) { u.Data = encoding.BytesToJSON(v.Data) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *EmptyResult) MarshalJSON() ([]byte, error) { u := struct { - Type TransactionType `json:"type"` + Type TransactionType `json:"type"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -18967,11 +19019,13 @@ func (v *EnableAccountAuthOperation) MarshalJSON() ([]byte, error) { u := struct { Type AccountAuthOperationType `json:"type"` Authority *url.URL `json:"authority,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Authority == nil) { u.Authority = v.Authority } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19002,23 +19056,22 @@ func (v *FactomDataEntryWrapper) MarshalJSON() ([]byte, error) { AccountId *string `json:"accountId,omitempty"` Data *string `json:"data,omitempty"` ExtIds encoding.JsonList[*string] `json:"extIds,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.FactomDataEntry.AccountId == ([32]byte{})) { - u.AccountId = encoding.ChainToJSON(&v.FactomDataEntry.AccountId) } if !(len(v.FactomDataEntry.Data) == 0) { - u.Data = encoding.BytesToJSON(v.FactomDataEntry.Data) } if !(len(v.FactomDataEntry.ExtIds) == 0) { - u.ExtIds = make(encoding.JsonList[*string], len(v.FactomDataEntry.ExtIds)) for i, x := range v.FactomDataEntry.ExtIds { u.ExtIds[i] = encoding.BytesToJSON(x) } } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19026,6 +19079,7 @@ func (v *FeeSchedule) MarshalJSON() ([]byte, error) { u := struct { CreateIdentitySliding encoding.JsonList[Fee] `json:"createIdentitySliding,omitempty"` CreateSubIdentity Fee `json:"createSubIdentity,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.CreateIdentitySliding) == 0) { u.CreateIdentitySliding = v.CreateIdentitySliding @@ -19033,6 +19087,7 @@ func (v *FeeSchedule) MarshalJSON() ([]byte, error) { if !(v.CreateSubIdentity == 0) { u.CreateSubIdentity = v.CreateSubIdentity } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19041,6 +19096,7 @@ func (v *InternalSignature) MarshalJSON() ([]byte, error) { Type SignatureType `json:"type"` Cause *string `json:"cause,omitempty"` TransactionHash *string `json:"transactionHash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Cause == ([32]byte{})) { @@ -19049,6 +19105,7 @@ func (v *InternalSignature) MarshalJSON() ([]byte, error) { if !(v.TransactionHash == ([32]byte{})) { u.TransactionHash = encoding.ChainToJSON(&v.TransactionHash) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19058,6 +19115,7 @@ func (v *IssueTokens) MarshalJSON() ([]byte, error) { Recipient *url.URL `json:"recipient,omitempty"` Amount *string `json:"amount,omitempty"` To encoding.JsonList[*TokenRecipient] `json:"to,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Recipient == nil) { @@ -19069,6 +19127,7 @@ func (v *IssueTokens) MarshalJSON() ([]byte, error) { if !(len(v.To) == 0) { u.To = v.To } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19079,6 +19138,7 @@ func (v *KeyBook) MarshalJSON() ([]byte, error) { BookType BookType `json:"bookType,omitempty"` Authorities encoding.JsonList[AuthorityEntry] `json:"authorities,omitempty"` PageCount uint64 `json:"pageCount,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { @@ -19088,12 +19148,12 @@ func (v *KeyBook) MarshalJSON() ([]byte, error) { u.BookType = v.BookType } if !(len(v.AccountAuth.Authorities) == 0) { - u.Authorities = v.AccountAuth.Authorities } if !(v.PageCount == 0) { u.PageCount = v.PageCount } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19111,6 +19171,7 @@ func (v *KeyPage) MarshalJSON() ([]byte, error) { Version uint64 `json:"version,omitempty"` Keys encoding.JsonList[*KeySpec] `json:"keys,omitempty"` TransactionBlacklist *AllowedTransactions `json:"transactionBlacklist,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.KeyBook() == nil) { @@ -19144,6 +19205,7 @@ func (v *KeyPage) MarshalJSON() ([]byte, error) { if !(v.TransactionBlacklist == nil) { u.TransactionBlacklist = v.TransactionBlacklist } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19153,6 +19215,7 @@ func (v *KeySpec) MarshalJSON() ([]byte, error) { PublicKey *string `json:"publicKey,omitempty"` LastUsedOn uint64 `json:"lastUsedOn,omitempty"` Delegate *url.URL `json:"delegate,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.PublicKeyHash) == 0) { u.PublicKeyHash = encoding.BytesToJSON(v.PublicKeyHash) @@ -19164,13 +19227,15 @@ func (v *KeySpec) MarshalJSON() ([]byte, error) { if !(v.Delegate == nil) { u.Delegate = v.Delegate } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *KeySpecParams) MarshalJSON() ([]byte, error) { u := struct { - KeyHash *string `json:"keyHash,omitempty"` - Delegate *url.URL `json:"delegate,omitempty"` + KeyHash *string `json:"keyHash,omitempty"` + Delegate *url.URL `json:"delegate,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.KeyHash) == 0) { u.KeyHash = encoding.BytesToJSON(v.KeyHash) @@ -19178,6 +19243,7 @@ func (v *KeySpecParams) MarshalJSON() ([]byte, error) { if !(v.Delegate == nil) { u.Delegate = v.Delegate } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19191,6 +19257,7 @@ func (v *LegacyED25519Signature) MarshalJSON() ([]byte, error) { SignerVersion uint64 `json:"signerVersion,omitempty"` Vote VoteType `json:"vote,omitempty"` TransactionHash *string `json:"transactionHash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Timestamp == 0) { @@ -19214,18 +19281,21 @@ func (v *LegacyED25519Signature) MarshalJSON() ([]byte, error) { if !(v.TransactionHash == ([32]byte{})) { u.TransactionHash = encoding.ChainToJSON(&v.TransactionHash) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *LiteDataAccount) MarshalJSON() ([]byte, error) { u := struct { - Type AccountType `json:"type"` - Url *url.URL `json:"url,omitempty"` + Type AccountType `json:"type"` + Url *url.URL `json:"url,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { u.Url = v.Url } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19235,6 +19305,7 @@ func (v *LiteIdentity) MarshalJSON() ([]byte, error) { Url *url.URL `json:"url,omitempty"` CreditBalance uint64 `json:"creditBalance,omitempty"` LastUsedOn uint64 `json:"lastUsedOn,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { @@ -19246,6 +19317,7 @@ func (v *LiteIdentity) MarshalJSON() ([]byte, error) { if !(v.LastUsedOn == 0) { u.LastUsedOn = v.LastUsedOn } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19256,6 +19328,7 @@ func (v *LiteTokenAccount) MarshalJSON() ([]byte, error) { TokenUrl *url.URL `json:"tokenUrl,omitempty"` Balance *string `json:"balance,omitempty"` LockHeight uint64 `json:"lockHeight,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { @@ -19270,25 +19343,29 @@ func (v *LiteTokenAccount) MarshalJSON() ([]byte, error) { if !(v.LockHeight == 0) { u.LockHeight = v.LockHeight } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *LockAccount) MarshalJSON() ([]byte, error) { u := struct { - Type TransactionType `json:"type"` - Height uint64 `json:"height,omitempty"` + Type TransactionType `json:"type"` + Height uint64 `json:"height,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Height == 0) { u.Height = v.Height } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *MetricsRequest) MarshalJSON() ([]byte, error) { u := struct { - Metric string `json:"metric,omitempty"` - Duration interface{} `json:"duration,omitempty"` + Metric string `json:"metric,omitempty"` + Duration interface{} `json:"duration,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Metric) == 0) { u.Metric = v.Metric @@ -19296,6 +19373,7 @@ func (v *MetricsRequest) MarshalJSON() ([]byte, error) { if !(v.Duration == 0) { u.Duration = encoding.DurationToJSON(v.Duration) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19311,8 +19389,9 @@ func (v *MetricsResponse) MarshalJSON() ([]byte, error) { func (v *NetworkAccountUpdate) MarshalJSON() ([]byte, error) { u := struct { - Name string `json:"name,omitempty"` - Body *encoding.JsonUnmarshalWith[TransactionBody] `json:"body,omitempty"` + Name string `json:"name,omitempty"` + Body *encoding.JsonUnmarshalWith[TransactionBody] `json:"body,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Name) == 0) { u.Name = v.Name @@ -19320,6 +19399,7 @@ func (v *NetworkAccountUpdate) MarshalJSON() ([]byte, error) { if !(EqualTransactionBody(v.Body, nil)) { u.Body = &encoding.JsonUnmarshalWith[TransactionBody]{Value: v.Body, Func: UnmarshalTransactionBodyJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19329,6 +19409,7 @@ func (v *NetworkDefinition) MarshalJSON() ([]byte, error) { Version uint64 `json:"version,omitempty"` Partitions encoding.JsonList[*PartitionInfo] `json:"partitions,omitempty"` Validators encoding.JsonList[*ValidatorInfo] `json:"validators,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.NetworkName) == 0) { u.NetworkName = v.NetworkName @@ -19342,6 +19423,7 @@ func (v *NetworkDefinition) MarshalJSON() ([]byte, error) { if !(len(v.Validators) == 0) { u.Validators = v.Validators } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19349,19 +19431,22 @@ func (v *NetworkMaintenance) MarshalJSON() ([]byte, error) { u := struct { Type TransactionType `json:"type"` Operations *encoding.JsonUnmarshalListWith[NetworkMaintenanceOperation] `json:"operations,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.Operations) == 0) { u.Operations = &encoding.JsonUnmarshalListWith[NetworkMaintenanceOperation]{Value: v.Operations, Func: UnmarshalNetworkMaintenanceOperationJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *Object) MarshalJSON() ([]byte, error) { u := struct { - Type ObjectType `json:"type,omitempty"` - Chains encoding.JsonList[ChainMetadata] `json:"chains,omitempty"` - Pending TxIdSet `json:"pending,omitempty"` + Type ObjectType `json:"type,omitempty"` + Chains encoding.JsonList[ChainMetadata] `json:"chains,omitempty"` + Pending TxIdSet `json:"pending,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Type == 0) { u.Type = v.Type @@ -19372,6 +19457,7 @@ func (v *Object) MarshalJSON() ([]byte, error) { if !((v.Pending).Equal(new(TxIdSet))) { u.Pending = v.Pending } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19383,6 +19469,7 @@ func (v *PartitionAnchor) MarshalJSON() ([]byte, error) { RootChainIndex uint64 `json:"rootChainIndex,omitempty"` RootChainAnchor *string `json:"rootChainAnchor,omitempty"` StateTreeAnchor *string `json:"stateTreeAnchor,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Source == nil) { u.Source = v.Source @@ -19402,6 +19489,7 @@ func (v *PartitionAnchor) MarshalJSON() ([]byte, error) { if !(v.StateTreeAnchor == ([32]byte{})) { u.StateTreeAnchor = encoding.ChainToJSON(&v.StateTreeAnchor) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19412,6 +19500,7 @@ func (v *PartitionSignature) MarshalJSON() ([]byte, error) { DestinationNetwork *url.URL `json:"destinationNetwork,omitempty"` SequenceNumber uint64 `json:"sequenceNumber,omitempty"` TransactionHash *string `json:"transactionHash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.SourceNetwork == nil) { @@ -19426,6 +19515,7 @@ func (v *PartitionSignature) MarshalJSON() ([]byte, error) { if !(v.TransactionHash == ([32]byte{})) { u.TransactionHash = encoding.ChainToJSON(&v.TransactionHash) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19436,6 +19526,7 @@ func (v *PartitionSyntheticLedger) MarshalJSON() ([]byte, error) { Received uint64 `json:"received,omitempty"` Delivered uint64 `json:"delivered,omitempty"` Pending encoding.JsonList[*url.TxID] `json:"pending,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Url == nil) { u.Url = v.Url @@ -19452,18 +19543,21 @@ func (v *PartitionSyntheticLedger) MarshalJSON() ([]byte, error) { if !(len(v.Pending) == 0) { u.Pending = v.Pending } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *PendingTransactionGCOperation) MarshalJSON() ([]byte, error) { u := struct { - Type NetworkMaintenanceOperationType `json:"type"` - Account *url.URL `json:"account,omitempty"` + Type NetworkMaintenanceOperationType `json:"type"` + Account *url.URL `json:"account,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Account == nil) { u.Account = v.Account } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19479,6 +19573,7 @@ func (v *RCD1Signature) MarshalJSON() ([]byte, error) { TransactionHash *string `json:"transactionHash,omitempty"` Memo string `json:"memo,omitempty"` Data *string `json:"data,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.PublicKey) == 0) { @@ -19508,6 +19603,7 @@ func (v *RCD1Signature) MarshalJSON() ([]byte, error) { if !(len(v.Data) == 0) { u.Data = encoding.BytesToJSON(v.Data) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19517,6 +19613,7 @@ func (v *ReceiptSignature) MarshalJSON() ([]byte, error) { SourceNetwork *url.URL `json:"sourceNetwork,omitempty"` Proof merkle.Receipt `json:"proof,omitempty"` TransactionHash *string `json:"transactionHash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.SourceNetwork == nil) { @@ -19528,6 +19625,7 @@ func (v *ReceiptSignature) MarshalJSON() ([]byte, error) { if !(v.TransactionHash == ([32]byte{})) { u.TransactionHash = encoding.ChainToJSON(&v.TransactionHash) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19537,6 +19635,7 @@ func (v *RemoteSignature) MarshalJSON() ([]byte, error) { Destination *url.URL `json:"destination,omitempty"` Signature *encoding.JsonUnmarshalWith[Signature] `json:"signature,omitempty"` Cause encoding.JsonList[*string] `json:"cause,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Destination == nil) { @@ -19551,18 +19650,21 @@ func (v *RemoteSignature) MarshalJSON() ([]byte, error) { u.Cause[i] = encoding.ChainToJSON(&x) } } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *RemoteTransaction) MarshalJSON() ([]byte, error) { u := struct { - Type TransactionType `json:"type"` - Hash *string `json:"hash,omitempty"` + Type TransactionType `json:"type"` + Hash *string `json:"hash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Hash == ([32]byte{})) { u.Hash = encoding.ChainToJSON(&v.Hash) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19570,23 +19672,27 @@ func (v *RemoveAccountAuthorityOperation) MarshalJSON() ([]byte, error) { u := struct { Type AccountAuthOperationType `json:"type"` Authority *url.URL `json:"authority,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Authority == nil) { u.Authority = v.Authority } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *RemoveKeyOperation) MarshalJSON() ([]byte, error) { u := struct { - Type KeyPageOperationType `json:"type"` - Entry KeySpecParams `json:"entry,omitempty"` + Type KeyPageOperationType `json:"type"` + Entry KeySpecParams `json:"entry,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !((v.Entry).Equal(new(KeySpecParams))) { u.Entry = v.Entry } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19594,6 +19700,7 @@ func (v *RoutingTable) MarshalJSON() ([]byte, error) { u := struct { Overrides encoding.JsonList[RouteOverride] `json:"overrides,omitempty"` Routes encoding.JsonList[Route] `json:"routes,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Overrides) == 0) { u.Overrides = v.Overrides @@ -19601,6 +19708,7 @@ func (v *RoutingTable) MarshalJSON() ([]byte, error) { if !(len(v.Routes) == 0) { u.Routes = v.Routes } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19616,6 +19724,7 @@ func (v *RsaSha256Signature) MarshalJSON() ([]byte, error) { TransactionHash *string `json:"transactionHash,omitempty"` Memo string `json:"memo,omitempty"` Data *string `json:"data,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.PublicKey) == 0) { @@ -19645,15 +19754,17 @@ func (v *RsaSha256Signature) MarshalJSON() ([]byte, error) { if !(len(v.Data) == 0) { u.Data = encoding.BytesToJSON(v.Data) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *SendTokens) MarshalJSON() ([]byte, error) { u := struct { - Type TransactionType `json:"type"` - Hash *string `json:"hash,omitempty"` - Meta json.RawMessage `json:"meta,omitempty"` - To encoding.JsonList[*TokenRecipient] `json:"to,omitempty"` + Type TransactionType `json:"type"` + Hash *string `json:"hash,omitempty"` + Meta json.RawMessage `json:"meta,omitempty"` + To encoding.JsonList[*TokenRecipient] `json:"to,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Hash == ([32]byte{})) { @@ -19665,6 +19776,7 @@ func (v *SendTokens) MarshalJSON() ([]byte, error) { if !(len(v.To) == 0) { u.To = v.To } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19672,11 +19784,13 @@ func (v *SetRejectThresholdKeyPageOperation) MarshalJSON() ([]byte, error) { u := struct { Type KeyPageOperationType `json:"type"` Threshold uint64 `json:"threshold,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Threshold == 0) { u.Threshold = v.Threshold } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19684,11 +19798,13 @@ func (v *SetResponseThresholdKeyPageOperation) MarshalJSON() ([]byte, error) { u := struct { Type KeyPageOperationType `json:"type"` Threshold uint64 `json:"threshold,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Threshold == 0) { u.Threshold = v.Threshold } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19696,11 +19812,13 @@ func (v *SetThresholdKeyPageOperation) MarshalJSON() ([]byte, error) { u := struct { Type KeyPageOperationType `json:"type"` Threshold uint64 `json:"threshold,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Threshold == 0) { u.Threshold = v.Threshold } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19712,6 +19830,7 @@ func (v *SignatureSet) MarshalJSON() ([]byte, error) { TransactionHash *string `json:"transactionHash,omitempty"` Signatures *encoding.JsonUnmarshalListWith[Signature] `json:"signatures,omitempty"` Authority *url.URL `json:"authority,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Vote == 0) { @@ -19729,6 +19848,7 @@ func (v *SignatureSet) MarshalJSON() ([]byte, error) { if !(v.Authority == nil) { u.Authority = v.Authority } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19742,26 +19862,22 @@ func (v *SyntheticBurnTokens) MarshalJSON() ([]byte, error) { Index uint64 `json:"index,omitempty"` Amount *string `json:"amount,omitempty"` IsRefund bool `json:"isRefund,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.SyntheticOrigin.Cause == nil) { - u.Cause = v.SyntheticOrigin.Cause } if !(v.SyntheticOrigin.Source() == nil) { - u.Source = v.SyntheticOrigin.Source() } if !(v.SyntheticOrigin.Initiator == nil) { - u.Initiator = v.SyntheticOrigin.Initiator } if !(v.SyntheticOrigin.FeeRefund == 0) { - u.FeeRefund = v.SyntheticOrigin.FeeRefund } if !(v.SyntheticOrigin.Index == 0) { - u.Index = v.SyntheticOrigin.Index } if !((v.Amount).Cmp(new(big.Int)) == 0) { @@ -19770,6 +19886,7 @@ func (v *SyntheticBurnTokens) MarshalJSON() ([]byte, error) { if !(!v.IsRefund) { u.IsRefund = v.IsRefund } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19782,31 +19899,28 @@ func (v *SyntheticCreateIdentity) MarshalJSON() ([]byte, error) { FeeRefund uint64 `json:"feeRefund,omitempty"` Index uint64 `json:"index,omitempty"` Accounts *encoding.JsonUnmarshalListWith[Account] `json:"accounts,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.SyntheticOrigin.Cause == nil) { - u.Cause = v.SyntheticOrigin.Cause } if !(v.SyntheticOrigin.Source() == nil) { - u.Source = v.SyntheticOrigin.Source() } if !(v.SyntheticOrigin.Initiator == nil) { - u.Initiator = v.SyntheticOrigin.Initiator } if !(v.SyntheticOrigin.FeeRefund == 0) { - u.FeeRefund = v.SyntheticOrigin.FeeRefund } if !(v.SyntheticOrigin.Index == 0) { - u.Index = v.SyntheticOrigin.Index } if !(len(v.Accounts) == 0) { u.Accounts = &encoding.JsonUnmarshalListWith[Account]{Value: v.Accounts, Func: UnmarshalAccountJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19821,26 +19935,22 @@ func (v *SyntheticDepositCredits) MarshalJSON() ([]byte, error) { Amount uint64 `json:"amount,omitempty"` AcmeRefundAmount *string `json:"acmeRefundAmount,omitempty"` IsRefund bool `json:"isRefund,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.SyntheticOrigin.Cause == nil) { - u.Cause = v.SyntheticOrigin.Cause } if !(v.SyntheticOrigin.Source() == nil) { - u.Source = v.SyntheticOrigin.Source() } if !(v.SyntheticOrigin.Initiator == nil) { - u.Initiator = v.SyntheticOrigin.Initiator } if !(v.SyntheticOrigin.FeeRefund == 0) { - u.FeeRefund = v.SyntheticOrigin.FeeRefund } if !(v.SyntheticOrigin.Index == 0) { - u.Index = v.SyntheticOrigin.Index } if !(v.Amount == 0) { @@ -19852,6 +19962,7 @@ func (v *SyntheticDepositCredits) MarshalJSON() ([]byte, error) { if !(!v.IsRefund) { u.IsRefund = v.IsRefund } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19867,26 +19978,22 @@ func (v *SyntheticDepositTokens) MarshalJSON() ([]byte, error) { Amount *string `json:"amount,omitempty"` IsIssuer bool `json:"isIssuer,omitempty"` IsRefund bool `json:"isRefund,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.SyntheticOrigin.Cause == nil) { - u.Cause = v.SyntheticOrigin.Cause } if !(v.SyntheticOrigin.Source() == nil) { - u.Source = v.SyntheticOrigin.Source() } if !(v.SyntheticOrigin.Initiator == nil) { - u.Initiator = v.SyntheticOrigin.Initiator } if !(v.SyntheticOrigin.FeeRefund == 0) { - u.FeeRefund = v.SyntheticOrigin.FeeRefund } if !(v.SyntheticOrigin.Index == 0) { - u.Index = v.SyntheticOrigin.Index } if !(v.Token == nil) { @@ -19901,6 +20008,7 @@ func (v *SyntheticDepositTokens) MarshalJSON() ([]byte, error) { if !(!v.IsRefund) { u.IsRefund = v.IsRefund } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19909,6 +20017,7 @@ func (v *SyntheticForwardTransaction) MarshalJSON() ([]byte, error) { Type TransactionType `json:"type"` Signatures encoding.JsonList[RemoteSignature] `json:"signatures,omitempty"` Transaction *Transaction `json:"transaction,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.Signatures) == 0) { @@ -19917,14 +20026,16 @@ func (v *SyntheticForwardTransaction) MarshalJSON() ([]byte, error) { if !(v.Transaction == nil) { u.Transaction = v.Transaction } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *SyntheticLedger) MarshalJSON() ([]byte, error) { u := struct { - Type AccountType `json:"type"` - Url *url.URL `json:"url,omitempty"` - Sequence encoding.JsonList[*PartitionSyntheticLedger] `json:"sequence,omitempty"` + Type AccountType `json:"type"` + Url *url.URL `json:"url,omitempty"` + Sequence encoding.JsonList[*PartitionSyntheticLedger] `json:"sequence,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { @@ -19933,6 +20044,7 @@ func (v *SyntheticLedger) MarshalJSON() ([]byte, error) { if !(len(v.Sequence) == 0) { u.Sequence = v.Sequence } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19945,39 +20057,38 @@ func (v *SyntheticWriteData) MarshalJSON() ([]byte, error) { FeeRefund uint64 `json:"feeRefund,omitempty"` Index uint64 `json:"index,omitempty"` Entry *encoding.JsonUnmarshalWith[DataEntry] `json:"entry,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.SyntheticOrigin.Cause == nil) { - u.Cause = v.SyntheticOrigin.Cause } if !(v.SyntheticOrigin.Source() == nil) { - u.Source = v.SyntheticOrigin.Source() } if !(v.SyntheticOrigin.Initiator == nil) { - u.Initiator = v.SyntheticOrigin.Initiator } if !(v.SyntheticOrigin.FeeRefund == 0) { - u.FeeRefund = v.SyntheticOrigin.FeeRefund } if !(v.SyntheticOrigin.Index == 0) { - u.Index = v.SyntheticOrigin.Index } if !(EqualDataEntry(v.Entry, nil)) { u.Entry = &encoding.JsonUnmarshalWith[DataEntry]{Value: v.Entry, Func: UnmarshalDataEntryJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *SystemGenesis) MarshalJSON() ([]byte, error) { u := struct { - Type TransactionType `json:"type"` + Type TransactionType `json:"type"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -19992,6 +20103,7 @@ func (v *SystemLedger) MarshalJSON() ([]byte, error) { Anchor *encoding.JsonUnmarshalWith[AnchorBody] `json:"anchor,omitempty"` ExecutorVersion ExecutorVersion `json:"executorVersion,omitempty"` BvnExecutorVersions encoding.JsonList[*PartitionExecutorVersion] `json:"bvnExecutorVersions,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { @@ -20018,6 +20130,7 @@ func (v *SystemLedger) MarshalJSON() ([]byte, error) { if !(len(v.BvnExecutorVersions) == 0) { u.BvnExecutorVersions = v.BvnExecutorVersions } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -20026,6 +20139,7 @@ func (v *SystemWriteData) MarshalJSON() ([]byte, error) { Type TransactionType `json:"type"` Entry *encoding.JsonUnmarshalWith[DataEntry] `json:"entry,omitempty"` WriteToState bool `json:"writeToState,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(EqualDataEntry(v.Entry, nil)) { @@ -20034,6 +20148,7 @@ func (v *SystemWriteData) MarshalJSON() ([]byte, error) { if !(!v.WriteToState) { u.WriteToState = v.WriteToState } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -20044,13 +20159,13 @@ func (v *TokenAccount) MarshalJSON() ([]byte, error) { Authorities encoding.JsonList[AuthorityEntry] `json:"authorities,omitempty"` TokenUrl *url.URL `json:"tokenUrl,omitempty"` Balance *string `json:"balance,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { u.Url = v.Url } if !(len(v.AccountAuth.Authorities) == 0) { - u.Authorities = v.AccountAuth.Authorities } if !(v.TokenUrl == nil) { @@ -20059,6 +20174,7 @@ func (v *TokenAccount) MarshalJSON() ([]byte, error) { if !((v.Balance).Cmp(new(big.Int)) == 0) { u.Balance = encoding.BigintToJSON(&v.Balance) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -20072,13 +20188,13 @@ func (v *TokenIssuer) MarshalJSON() ([]byte, error) { Properties *url.URL `json:"properties,omitempty"` Issued *string `json:"issued,omitempty"` SupplyLimit *string `json:"supplyLimit,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { u.Url = v.Url } if !(len(v.AccountAuth.Authorities) == 0) { - u.Authorities = v.AccountAuth.Authorities } if !(len(v.Symbol) == 0) { @@ -20096,13 +20212,15 @@ func (v *TokenIssuer) MarshalJSON() ([]byte, error) { if !(v.SupplyLimit == nil) { u.SupplyLimit = encoding.BigintToJSON(v.SupplyLimit) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *TokenRecipient) MarshalJSON() ([]byte, error) { u := struct { - Url *url.URL `json:"url,omitempty"` - Amount *string `json:"amount,omitempty"` + Url *url.URL `json:"url,omitempty"` + Amount *string `json:"amount,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Url == nil) { u.Url = v.Url @@ -20110,13 +20228,15 @@ func (v *TokenRecipient) MarshalJSON() ([]byte, error) { if !((v.Amount).Cmp(new(big.Int)) == 0) { u.Amount = encoding.BigintToJSON(&v.Amount) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *Transaction) MarshalJSON() ([]byte, error) { u := struct { - Header TransactionHeader `json:"header,omitempty"` - Body *encoding.JsonUnmarshalWith[TransactionBody] `json:"body,omitempty"` + Header TransactionHeader `json:"header,omitempty"` + Body *encoding.JsonUnmarshalWith[TransactionBody] `json:"body,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !((v.Header).Equal(new(TransactionHeader))) { u.Header = v.Header @@ -20124,6 +20244,7 @@ func (v *Transaction) MarshalJSON() ([]byte, error) { if !(EqualTransactionBody(v.Body, nil)) { u.Body = &encoding.JsonUnmarshalWith[TransactionBody]{Value: v.Body, Func: UnmarshalTransactionBodyJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -20136,6 +20257,7 @@ func (v *TransactionHeader) MarshalJSON() ([]byte, error) { Expire *ExpireOptions `json:"expire,omitempty"` HoldUntil *HoldUntilOptions `json:"holdUntil,omitempty"` Authorities encoding.JsonList[*url.URL] `json:"authorities,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Principal == nil) { u.Principal = v.Principal @@ -20158,16 +20280,19 @@ func (v *TransactionHeader) MarshalJSON() ([]byte, error) { if !(len(v.Authorities) == 0) { u.Authorities = v.Authorities } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *TransactionResultSet) MarshalJSON() ([]byte, error) { u := struct { - Results encoding.JsonList[*TransactionStatus] `json:"results,omitempty"` + Results encoding.JsonList[*TransactionStatus] `json:"results,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Results) == 0) { u.Results = v.Results } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -20191,6 +20316,7 @@ func (v *TransactionStatus) MarshalJSON() ([]byte, error) { GotDirectoryReceipt bool `json:"gotDirectoryReceipt,omitempty"` Proof *merkle.Receipt `json:"proof,omitempty"` AnchorSigners encoding.JsonList[*string] `json:"anchorSigners,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.TxID == nil) { u.TxID = v.TxID @@ -20249,48 +20375,56 @@ func (v *TransactionStatus) MarshalJSON() ([]byte, error) { u.AnchorSigners[i] = encoding.BytesToJSON(x) } } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *TransferCredits) MarshalJSON() ([]byte, error) { u := struct { - Type TransactionType `json:"type"` - To encoding.JsonList[*CreditRecipient] `json:"to,omitempty"` + Type TransactionType `json:"type"` + To encoding.JsonList[*CreditRecipient] `json:"to,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.To) == 0) { u.To = v.To } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *TxIdSet) MarshalJSON() ([]byte, error) { u := struct { - Entries encoding.JsonList[*url.TxID] `json:"entries,omitempty"` + Entries encoding.JsonList[*url.TxID] `json:"entries,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Entries) == 0) { u.Entries = v.Entries } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *UnknownAccount) MarshalJSON() ([]byte, error) { u := struct { - Type AccountType `json:"type"` - Url *url.URL `json:"url,omitempty"` + Type AccountType `json:"type"` + Url *url.URL `json:"url,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { u.Url = v.Url } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *UnknownSigner) MarshalJSON() ([]byte, error) { u := struct { - Type AccountType `json:"type"` - Url *url.URL `json:"url,omitempty"` - Version uint64 `json:"version,omitempty"` + Type AccountType `json:"type"` + Url *url.URL `json:"url,omitempty"` + Version uint64 `json:"version,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Url == nil) { @@ -20299,6 +20433,7 @@ func (v *UnknownSigner) MarshalJSON() ([]byte, error) { if !(v.Version == 0) { u.Version = v.Version } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -20306,19 +20441,22 @@ func (v *UpdateAccountAuth) MarshalJSON() ([]byte, error) { u := struct { Type TransactionType `json:"type"` Operations *encoding.JsonUnmarshalListWith[AccountAuthOperation] `json:"operations,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.Operations) == 0) { u.Operations = &encoding.JsonUnmarshalListWith[AccountAuthOperation]{Value: v.Operations, Func: UnmarshalAccountAuthOperationJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *UpdateAllowedKeyPageOperation) MarshalJSON() ([]byte, error) { u := struct { - Type KeyPageOperationType `json:"type"` - Allow encoding.JsonList[TransactionType] `json:"allow,omitempty"` - Deny encoding.JsonList[TransactionType] `json:"deny,omitempty"` + Type KeyPageOperationType `json:"type"` + Allow encoding.JsonList[TransactionType] `json:"allow,omitempty"` + Deny encoding.JsonList[TransactionType] `json:"deny,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.Allow) == 0) { @@ -20327,6 +20465,7 @@ func (v *UpdateAllowedKeyPageOperation) MarshalJSON() ([]byte, error) { if !(len(v.Deny) == 0) { u.Deny = v.Deny } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -20334,19 +20473,22 @@ func (v *UpdateKey) MarshalJSON() ([]byte, error) { u := struct { Type TransactionType `json:"type"` NewKeyHash *string `json:"newKeyHash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.NewKeyHash) == 0) { u.NewKeyHash = encoding.BytesToJSON(v.NewKeyHash) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *UpdateKeyOperation) MarshalJSON() ([]byte, error) { u := struct { - Type KeyPageOperationType `json:"type"` - OldEntry KeySpecParams `json:"oldEntry,omitempty"` - NewEntry KeySpecParams `json:"newEntry,omitempty"` + Type KeyPageOperationType `json:"type"` + OldEntry KeySpecParams `json:"oldEntry,omitempty"` + NewEntry KeySpecParams `json:"newEntry,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !((v.OldEntry).Equal(new(KeySpecParams))) { @@ -20355,6 +20497,7 @@ func (v *UpdateKeyOperation) MarshalJSON() ([]byte, error) { if !((v.NewEntry).Equal(new(KeySpecParams))) { u.NewEntry = v.NewEntry } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -20362,11 +20505,13 @@ func (v *UpdateKeyPage) MarshalJSON() ([]byte, error) { u := struct { Type TransactionType `json:"type"` Operation *encoding.JsonUnmarshalListWith[KeyPageOperation] `json:"operation,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.Operation) == 0) { u.Operation = &encoding.JsonUnmarshalListWith[KeyPageOperation]{Value: v.Operation, Func: UnmarshalKeyPageOperationJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -20376,6 +20521,7 @@ func (v *ValidatorInfo) MarshalJSON() ([]byte, error) { PublicKeyHash *string `json:"publicKeyHash,omitempty"` Operator *url.URL `json:"operator,omitempty"` Partitions encoding.JsonList[*ValidatorPartitionInfo] `json:"partitions,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.PublicKey) == 0) { u.PublicKey = encoding.BytesToJSON(v.PublicKey) @@ -20389,6 +20535,7 @@ func (v *ValidatorInfo) MarshalJSON() ([]byte, error) { if !(len(v.Partitions) == 0) { u.Partitions = v.Partitions } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -20398,6 +20545,7 @@ func (v *WriteData) MarshalJSON() ([]byte, error) { Entry *encoding.JsonUnmarshalWith[DataEntry] `json:"entry,omitempty"` Scratch bool `json:"scratch,omitempty"` WriteToState bool `json:"writeToState,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(EqualDataEntry(v.Entry, nil)) { @@ -20409,6 +20557,7 @@ func (v *WriteData) MarshalJSON() ([]byte, error) { if !(!v.WriteToState) { u.WriteToState = v.WriteToState } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -20418,6 +20567,7 @@ func (v *WriteDataResult) MarshalJSON() ([]byte, error) { EntryHash *string `json:"entryHash,omitempty"` AccountUrl *url.URL `json:"accountUrl,omitempty"` AccountID *string `json:"accountID,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.EntryHash == ([32]byte{})) { @@ -20429,6 +20579,7 @@ func (v *WriteDataResult) MarshalJSON() ([]byte, error) { if !(len(v.AccountID) == 0) { u.AccountID = encoding.BytesToJSON(v.AccountID) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -20437,6 +20588,7 @@ func (v *WriteDataTo) MarshalJSON() ([]byte, error) { Type TransactionType `json:"type"` Recipient *url.URL `json:"recipient,omitempty"` Entry *encoding.JsonUnmarshalWith[DataEntry] `json:"entry,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Recipient == nil) { @@ -20445,6 +20597,7 @@ func (v *WriteDataTo) MarshalJSON() ([]byte, error) { if !(EqualDataEntry(v.Entry, nil)) { u.Entry = &encoding.JsonUnmarshalWith[DataEntry]{Value: v.Entry, Func: UnmarshalDataEntryJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -20453,11 +20606,13 @@ func (v *ADI) UnmarshalJSON(data []byte) error { Type AccountType `json:"type"` Url *url.URL `json:"url,omitempty"` Authorities encoding.JsonList[AuthorityEntry] `json:"authorities,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url u.Authorities = v.AccountAuth.Authorities - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -20465,32 +20620,44 @@ func (v *ADI) UnmarshalJSON(data []byte) error { } v.Url = u.Url v.AccountAuth.Authorities = u.Authorities + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *AccountAuth) UnmarshalJSON(data []byte) error { u := struct { Authorities encoding.JsonList[AuthorityEntry] `json:"authorities,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Authorities = v.Authorities - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Authorities = u.Authorities + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *AccumulateDataEntry) UnmarshalJSON(data []byte) error { u := struct { - Type DataEntryType `json:"type"` - Data encoding.JsonList[*string] `json:"data,omitempty"` + Type DataEntryType `json:"type"` + Data encoding.JsonList[*string] `json:"data,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Data = make(encoding.JsonList[*string], len(v.Data)) for i, x := range v.Data { u.Data[i] = encoding.BytesToJSON(x) } - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -20504,40 +20671,56 @@ func (v *AccumulateDataEntry) UnmarshalJSON(data []byte) error { v.Data[i] = x } } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *AcmeFaucet) UnmarshalJSON(data []byte) error { u := struct { - Type TransactionType `json:"type"` - Url *url.URL `json:"url,omitempty"` + Type TransactionType `json:"type"` + Url *url.URL `json:"url,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Url = u.Url + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *ActivateProtocolVersion) UnmarshalJSON(data []byte) error { u := struct { - Type TransactionType `json:"type"` - Version ExecutorVersion `json:"version,omitempty"` + Type TransactionType `json:"type"` + Version ExecutorVersion `json:"version,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Version = v.Version - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Version = u.Version + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -20545,16 +20728,22 @@ func (v *AddAccountAuthorityOperation) UnmarshalJSON(data []byte) error { u := struct { Type AccountAuthOperationType `json:"type"` Authority *url.URL `json:"authority,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Authority = v.Authority - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Authority = u.Authority + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -20564,12 +20753,14 @@ func (v *AddCredits) UnmarshalJSON(data []byte) error { Recipient *url.URL `json:"recipient,omitempty"` Amount *string `json:"amount,omitempty"` Oracle uint64 `json:"oracle,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Recipient = v.Recipient u.Amount = encoding.BigintToJSON(&v.Amount) u.Oracle = v.Oracle - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -20582,21 +20773,27 @@ func (v *AddCredits) UnmarshalJSON(data []byte) error { v.Amount = *x } v.Oracle = u.Oracle + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *AddCreditsResult) UnmarshalJSON(data []byte) error { u := struct { - Type TransactionType `json:"type"` - Amount *string `json:"amount,omitempty"` - Credits uint64 `json:"credits,omitempty"` - Oracle uint64 `json:"oracle,omitempty"` + Type TransactionType `json:"type"` + Amount *string `json:"amount,omitempty"` + Credits uint64 `json:"credits,omitempty"` + Oracle uint64 `json:"oracle,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Amount = encoding.BigintToJSON(&v.Amount) u.Credits = v.Credits u.Oracle = v.Oracle - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -20609,23 +20806,33 @@ func (v *AddCreditsResult) UnmarshalJSON(data []byte) error { } v.Credits = u.Credits v.Oracle = u.Oracle + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *AddKeyOperation) UnmarshalJSON(data []byte) error { u := struct { - Type KeyPageOperationType `json:"type"` - Entry KeySpecParams `json:"entry,omitempty"` + Type KeyPageOperationType `json:"type"` + Entry KeySpecParams `json:"entry,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Entry = v.Entry - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Entry = u.Entry + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -20638,6 +20845,7 @@ func (v *AnchorLedger) UnmarshalJSON(data []byte) error { MajorBlockTime time.Time `json:"majorBlockTime,omitempty"` PendingMajorBlockAnchors encoding.JsonList[*url.URL] `json:"pendingMajorBlockAnchors,omitempty"` Sequence encoding.JsonList[*PartitionSyntheticLedger] `json:"sequence,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url @@ -20646,7 +20854,8 @@ func (v *AnchorLedger) UnmarshalJSON(data []byte) error { u.MajorBlockTime = v.MajorBlockTime u.PendingMajorBlockAnchors = v.PendingMajorBlockAnchors u.Sequence = v.Sequence - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -20658,6 +20867,10 @@ func (v *AnchorLedger) UnmarshalJSON(data []byte) error { v.MajorBlockTime = u.MajorBlockTime v.PendingMajorBlockAnchors = u.PendingMajorBlockAnchors v.Sequence = u.Sequence + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -20670,6 +20883,7 @@ func (v *AnchorMetadata) UnmarshalJSON(data []byte) error { SourceIndex uint64 `json:"sourceIndex,omitempty"` SourceBlock uint64 `json:"sourceBlock,omitempty"` Entry *string `json:"entry,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Name = v.ChainMetadata.Name u.Type = v.ChainMetadata.Type @@ -20678,7 +20892,8 @@ func (v *AnchorMetadata) UnmarshalJSON(data []byte) error { u.SourceIndex = v.SourceIndex u.SourceBlock = v.SourceBlock u.Entry = encoding.BytesToJSON(v.Entry) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.ChainMetadata.Name = u.Name @@ -20692,6 +20907,10 @@ func (v *AnchorMetadata) UnmarshalJSON(data []byte) error { } else { v.Entry = x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -20705,6 +20924,7 @@ func (v *AuthoritySignature) UnmarshalJSON(data []byte) error { Cause *url.TxID `json:"cause,omitempty"` Delegator encoding.JsonList[*url.URL] `json:"delegator,omitempty"` Memo string `json:"memo,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Origin = v.Origin @@ -20714,7 +20934,8 @@ func (v *AuthoritySignature) UnmarshalJSON(data []byte) error { u.Cause = v.Cause u.Delegator = v.Delegator u.Memo = v.Memo - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -20727,6 +20948,10 @@ func (v *AuthoritySignature) UnmarshalJSON(data []byte) error { v.Cause = u.Cause v.Delegator = u.Delegator v.Memo = u.Memo + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -20742,6 +20967,7 @@ func (v *BTCLegacySignature) UnmarshalJSON(data []byte) error { TransactionHash *string `json:"transactionHash,omitempty"` Memo string `json:"memo,omitempty"` Data *string `json:"data,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.PublicKey = encoding.BytesToJSON(v.PublicKey) @@ -20753,7 +20979,8 @@ func (v *BTCLegacySignature) UnmarshalJSON(data []byte) error { u.TransactionHash = encoding.ChainToJSON(&v.TransactionHash) u.Memo = v.Memo u.Data = encoding.BytesToJSON(v.Data) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -20784,6 +21011,10 @@ func (v *BTCLegacySignature) UnmarshalJSON(data []byte) error { } else { v.Data = x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -20799,6 +21030,7 @@ func (v *BTCSignature) UnmarshalJSON(data []byte) error { TransactionHash *string `json:"transactionHash,omitempty"` Memo string `json:"memo,omitempty"` Data *string `json:"data,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.PublicKey = encoding.BytesToJSON(v.PublicKey) @@ -20810,7 +21042,8 @@ func (v *BTCSignature) UnmarshalJSON(data []byte) error { u.TransactionHash = encoding.ChainToJSON(&v.TransactionHash) u.Memo = v.Memo u.Data = encoding.BytesToJSON(v.Data) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -20841,23 +21074,29 @@ func (v *BTCSignature) UnmarshalJSON(data []byte) error { } else { v.Data = x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *BlockLedger) UnmarshalJSON(data []byte) error { u := struct { - Type AccountType `json:"type"` - Url *url.URL `json:"url,omitempty"` - Index uint64 `json:"index,omitempty"` - Time time.Time `json:"time,omitempty"` - Entries encoding.JsonList[*BlockEntry] `json:"entries,omitempty"` + Type AccountType `json:"type"` + Url *url.URL `json:"url,omitempty"` + Index uint64 `json:"index,omitempty"` + Time time.Time `json:"time,omitempty"` + Entries encoding.JsonList[*BlockEntry] `json:"entries,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url u.Index = v.Index u.Time = v.Time u.Entries = v.Entries - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -20867,6 +21106,10 @@ func (v *BlockLedger) UnmarshalJSON(data []byte) error { v.Index = u.Index v.Time = u.Time v.Entries = u.Entries + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -20880,6 +21123,7 @@ func (v *BlockValidatorAnchor) UnmarshalJSON(data []byte) error { RootChainAnchor *string `json:"rootChainAnchor,omitempty"` StateTreeAnchor *string `json:"stateTreeAnchor,omitempty"` AcmeBurnt *string `json:"acmeBurnt,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Source = v.PartitionAnchor.Source @@ -20889,7 +21133,8 @@ func (v *BlockValidatorAnchor) UnmarshalJSON(data []byte) error { u.RootChainAnchor = encoding.ChainToJSON(&v.PartitionAnchor.RootChainAnchor) u.StateTreeAnchor = encoding.ChainToJSON(&v.PartitionAnchor.StateTreeAnchor) u.AcmeBurnt = encoding.BigintToJSON(&v.AcmeBurnt) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -20914,34 +21159,46 @@ func (v *BlockValidatorAnchor) UnmarshalJSON(data []byte) error { } else { v.AcmeBurnt = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *BurnCredits) UnmarshalJSON(data []byte) error { u := struct { - Type TransactionType `json:"type"` - Amount uint64 `json:"amount,omitempty"` + Type TransactionType `json:"type"` + Amount uint64 `json:"amount,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Amount = v.Amount - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Amount = u.Amount + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *BurnTokens) UnmarshalJSON(data []byte) error { u := struct { - Type TransactionType `json:"type"` - Amount *string `json:"amount,omitempty"` + Type TransactionType `json:"type"` + Amount *string `json:"amount,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Amount = encoding.BigintToJSON(&v.Amount) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -20952,17 +21209,23 @@ func (v *BurnTokens) UnmarshalJSON(data []byte) error { } else { v.Amount = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *ChainParams) UnmarshalJSON(data []byte) error { u := struct { - Data *string `json:"data,omitempty"` - IsUpdate bool `json:"isUpdate,omitempty"` + Data *string `json:"data,omitempty"` + IsUpdate bool `json:"isUpdate,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Data = encoding.BytesToJSON(v.Data) u.IsUpdate = v.IsUpdate - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if x, err := encoding.BytesFromJSON(u.Data); err != nil { @@ -20971,6 +21234,10 @@ func (v *ChainParams) UnmarshalJSON(data []byte) error { v.Data = x } v.IsUpdate = u.IsUpdate + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -20979,11 +21246,13 @@ func (v *CreateDataAccount) UnmarshalJSON(data []byte) error { Type TransactionType `json:"type"` Url *url.URL `json:"url,omitempty"` Authorities encoding.JsonList[*url.URL] `json:"authorities,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url u.Authorities = v.Authorities - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -20991,6 +21260,10 @@ func (v *CreateDataAccount) UnmarshalJSON(data []byte) error { } v.Url = u.Url v.Authorities = u.Authorities + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21001,13 +21274,15 @@ func (v *CreateIdentity) UnmarshalJSON(data []byte) error { KeyHash *string `json:"keyHash,omitempty"` KeyBookUrl *url.URL `json:"keyBookUrl,omitempty"` Authorities encoding.JsonList[*url.URL] `json:"authorities,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url u.KeyHash = encoding.BytesToJSON(v.KeyHash) u.KeyBookUrl = v.KeyBookUrl u.Authorities = v.Authorities - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -21021,6 +21296,10 @@ func (v *CreateIdentity) UnmarshalJSON(data []byte) error { } v.KeyBookUrl = u.KeyBookUrl v.Authorities = u.Authorities + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21030,12 +21309,14 @@ func (v *CreateKeyBook) UnmarshalJSON(data []byte) error { Url *url.URL `json:"url,omitempty"` PublicKeyHash *string `json:"publicKeyHash,omitempty"` Authorities encoding.JsonList[*url.URL] `json:"authorities,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url u.PublicKeyHash = encoding.BytesToJSON(v.PublicKeyHash) u.Authorities = v.Authorities - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -21048,37 +21329,53 @@ func (v *CreateKeyBook) UnmarshalJSON(data []byte) error { v.PublicKeyHash = x } v.Authorities = u.Authorities + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *CreateKeyPage) UnmarshalJSON(data []byte) error { u := struct { - Type TransactionType `json:"type"` - Keys encoding.JsonList[*KeySpecParams] `json:"keys,omitempty"` + Type TransactionType `json:"type"` + Keys encoding.JsonList[*KeySpecParams] `json:"keys,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Keys = v.Keys - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Keys = u.Keys + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *CreateLiteTokenAccount) UnmarshalJSON(data []byte) error { u := struct { - Type TransactionType `json:"type"` + Type TransactionType `json:"type"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21091,6 +21388,7 @@ func (v *CreateToken) UnmarshalJSON(data []byte) error { Properties *url.URL `json:"properties,omitempty"` SupplyLimit *string `json:"supplyLimit,omitempty"` Authorities encoding.JsonList[*url.URL] `json:"authorities,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url @@ -21099,7 +21397,8 @@ func (v *CreateToken) UnmarshalJSON(data []byte) error { u.Properties = v.Properties u.SupplyLimit = encoding.BigintToJSON(v.SupplyLimit) u.Authorities = v.Authorities - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -21117,6 +21416,10 @@ func (v *CreateToken) UnmarshalJSON(data []byte) error { } } v.Authorities = u.Authorities + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21127,13 +21430,15 @@ func (v *CreateTokenAccount) UnmarshalJSON(data []byte) error { TokenUrl *url.URL `json:"tokenUrl,omitempty"` Authorities encoding.JsonList[*url.URL] `json:"authorities,omitempty"` Proof *TokenIssuerProof `json:"proof,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url u.TokenUrl = v.TokenUrl u.Authorities = v.Authorities u.Proof = v.Proof - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -21143,6 +21448,10 @@ func (v *CreateTokenAccount) UnmarshalJSON(data []byte) error { v.TokenUrl = u.TokenUrl v.Authorities = u.Authorities v.Proof = u.Proof + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21152,12 +21461,14 @@ func (v *DataAccount) UnmarshalJSON(data []byte) error { Url *url.URL `json:"url,omitempty"` Authorities encoding.JsonList[AuthorityEntry] `json:"authorities,omitempty"` Entry *encoding.JsonUnmarshalWith[DataEntry] `json:"entry,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url u.Authorities = v.AccountAuth.Authorities u.Entry = &encoding.JsonUnmarshalWith[DataEntry]{Value: v.Entry, Func: UnmarshalDataEntryJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -21169,6 +21480,10 @@ func (v *DataAccount) UnmarshalJSON(data []byte) error { v.Entry = u.Entry.Value } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21177,11 +21492,13 @@ func (v *DelegatedSignature) UnmarshalJSON(data []byte) error { Type SignatureType `json:"type"` Signature *encoding.JsonUnmarshalWith[Signature] `json:"signature,omitempty"` Delegator *url.URL `json:"delegator,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Signature = &encoding.JsonUnmarshalWith[Signature]{Value: v.Signature, Func: UnmarshalSignatureJSON} u.Delegator = v.Delegator - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -21192,6 +21509,10 @@ func (v *DelegatedSignature) UnmarshalJSON(data []byte) error { } v.Delegator = u.Delegator + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21208,6 +21529,7 @@ func (v *DirectoryAnchor) UnmarshalJSON(data []byte) error { Receipts encoding.JsonList[*PartitionAnchorReceipt] `json:"receipts,omitempty"` MakeMajorBlock uint64 `json:"makeMajorBlock,omitempty"` MakeMajorBlockTime time.Time `json:"makeMajorBlockTime,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Source = v.PartitionAnchor.Source @@ -21220,7 +21542,8 @@ func (v *DirectoryAnchor) UnmarshalJSON(data []byte) error { u.Receipts = v.Receipts u.MakeMajorBlock = v.MakeMajorBlock u.MakeMajorBlockTime = v.MakeMajorBlockTime - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -21244,6 +21567,10 @@ func (v *DirectoryAnchor) UnmarshalJSON(data []byte) error { v.Receipts = u.Receipts v.MakeMajorBlock = u.MakeMajorBlock v.MakeMajorBlockTime = u.MakeMajorBlockTime + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21251,30 +21578,38 @@ func (v *DisableAccountAuthOperation) UnmarshalJSON(data []byte) error { u := struct { Type AccountAuthOperationType `json:"type"` Authority *url.URL `json:"authority,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Authority = v.Authority - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Authority = u.Authority + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *DoubleHashDataEntry) UnmarshalJSON(data []byte) error { u := struct { - Type DataEntryType `json:"type"` - Data encoding.JsonList[*string] `json:"data,omitempty"` + Type DataEntryType `json:"type"` + Data encoding.JsonList[*string] `json:"data,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Data = make(encoding.JsonList[*string], len(v.Data)) for i, x := range v.Data { u.Data[i] = encoding.BytesToJSON(x) } - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -21288,6 +21623,10 @@ func (v *DoubleHashDataEntry) UnmarshalJSON(data []byte) error { v.Data[i] = x } } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21303,6 +21642,7 @@ func (v *ED25519Signature) UnmarshalJSON(data []byte) error { TransactionHash *string `json:"transactionHash,omitempty"` Memo string `json:"memo,omitempty"` Data *string `json:"data,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.PublicKey = encoding.BytesToJSON(v.PublicKey) @@ -21314,7 +21654,8 @@ func (v *ED25519Signature) UnmarshalJSON(data []byte) error { u.TransactionHash = encoding.ChainToJSON(&v.TransactionHash) u.Memo = v.Memo u.Data = encoding.BytesToJSON(v.Data) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -21345,6 +21686,10 @@ func (v *ED25519Signature) UnmarshalJSON(data []byte) error { } else { v.Data = x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21360,6 +21705,7 @@ func (v *ETHSignature) UnmarshalJSON(data []byte) error { TransactionHash *string `json:"transactionHash,omitempty"` Memo string `json:"memo,omitempty"` Data *string `json:"data,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.PublicKey = encoding.BytesToJSON(v.PublicKey) @@ -21371,7 +21717,8 @@ func (v *ETHSignature) UnmarshalJSON(data []byte) error { u.TransactionHash = encoding.ChainToJSON(&v.TransactionHash) u.Memo = v.Memo u.Data = encoding.BytesToJSON(v.Data) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -21402,20 +21749,30 @@ func (v *ETHSignature) UnmarshalJSON(data []byte) error { } else { v.Data = x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *EmptyResult) UnmarshalJSON(data []byte) error { u := struct { - Type TransactionType `json:"type"` + Type TransactionType `json:"type"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21423,16 +21780,22 @@ func (v *EnableAccountAuthOperation) UnmarshalJSON(data []byte) error { u := struct { Type AccountAuthOperationType `json:"type"` Authority *url.URL `json:"authority,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Authority = v.Authority - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Authority = u.Authority + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21448,7 +21811,8 @@ func (v *FactomDataEntry) UnmarshalJSON(data []byte) error { for i, x := range v.ExtIds { u.ExtIds[i] = encoding.BytesToJSON(x) } - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if x, err := encoding.ChainFromJSON(u.AccountId); err != nil { @@ -21478,6 +21842,7 @@ func (v *FactomDataEntryWrapper) UnmarshalJSON(data []byte) error { AccountId *string `json:"accountId,omitempty"` Data *string `json:"data,omitempty"` ExtIds encoding.JsonList[*string] `json:"extIds,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.AccountId = encoding.ChainToJSON(&v.FactomDataEntry.AccountId) @@ -21486,7 +21851,8 @@ func (v *FactomDataEntryWrapper) UnmarshalJSON(data []byte) error { for i, x := range v.FactomDataEntry.ExtIds { u.ExtIds[i] = encoding.BytesToJSON(x) } - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -21510,6 +21876,10 @@ func (v *FactomDataEntryWrapper) UnmarshalJSON(data []byte) error { v.FactomDataEntry.ExtIds[i] = x } } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21517,14 +21887,20 @@ func (v *FeeSchedule) UnmarshalJSON(data []byte) error { u := struct { CreateIdentitySliding encoding.JsonList[Fee] `json:"createIdentitySliding,omitempty"` CreateSubIdentity Fee `json:"createSubIdentity,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.CreateIdentitySliding = v.CreateIdentitySliding u.CreateSubIdentity = v.CreateSubIdentity - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.CreateIdentitySliding = u.CreateIdentitySliding v.CreateSubIdentity = u.CreateSubIdentity + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21533,11 +21909,13 @@ func (v *InternalSignature) UnmarshalJSON(data []byte) error { Type SignatureType `json:"type"` Cause *string `json:"cause,omitempty"` TransactionHash *string `json:"transactionHash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Cause = encoding.ChainToJSON(&v.Cause) u.TransactionHash = encoding.ChainToJSON(&v.TransactionHash) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -21553,6 +21931,10 @@ func (v *InternalSignature) UnmarshalJSON(data []byte) error { } else { v.TransactionHash = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21562,12 +21944,14 @@ func (v *IssueTokens) UnmarshalJSON(data []byte) error { Recipient *url.URL `json:"recipient,omitempty"` Amount *string `json:"amount,omitempty"` To encoding.JsonList[*TokenRecipient] `json:"to,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Recipient = v.Recipient u.Amount = encoding.BigintToJSON(&v.Amount) u.To = v.To - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -21580,6 +21964,10 @@ func (v *IssueTokens) UnmarshalJSON(data []byte) error { v.Amount = *x } v.To = u.To + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21590,13 +21978,15 @@ func (v *KeyBook) UnmarshalJSON(data []byte) error { BookType BookType `json:"bookType,omitempty"` Authorities encoding.JsonList[AuthorityEntry] `json:"authorities,omitempty"` PageCount uint64 `json:"pageCount,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url u.BookType = v.BookType u.Authorities = v.AccountAuth.Authorities u.PageCount = v.PageCount - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -21606,6 +21996,10 @@ func (v *KeyBook) UnmarshalJSON(data []byte) error { v.BookType = u.BookType v.AccountAuth.Authorities = u.Authorities v.PageCount = u.PageCount + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21623,6 +22017,7 @@ func (v *KeyPage) UnmarshalJSON(data []byte) error { Version uint64 `json:"version,omitempty"` Keys encoding.JsonList[*KeySpec] `json:"keys,omitempty"` TransactionBlacklist *AllowedTransactions `json:"transactionBlacklist,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.KeyBook = v.KeyBook() @@ -21636,7 +22031,8 @@ func (v *KeyPage) UnmarshalJSON(data []byte) error { u.Version = v.Version u.Keys = v.Keys u.TransactionBlacklist = v.TransactionBlacklist - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -21655,6 +22051,10 @@ func (v *KeyPage) UnmarshalJSON(data []byte) error { v.Version = u.Version v.Keys = u.Keys v.TransactionBlacklist = u.TransactionBlacklist + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21664,12 +22064,14 @@ func (v *KeySpec) UnmarshalJSON(data []byte) error { PublicKey *string `json:"publicKey,omitempty"` LastUsedOn uint64 `json:"lastUsedOn,omitempty"` Delegate *url.URL `json:"delegate,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.PublicKeyHash = encoding.BytesToJSON(v.PublicKeyHash) u.PublicKey = encoding.BytesToJSON(v.PublicKeyHash) u.LastUsedOn = v.LastUsedOn u.Delegate = v.Delegate - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(u.PublicKeyHash == nil) { @@ -21687,17 +22089,23 @@ func (v *KeySpec) UnmarshalJSON(data []byte) error { } v.LastUsedOn = u.LastUsedOn v.Delegate = u.Delegate + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *KeySpecParams) UnmarshalJSON(data []byte) error { u := struct { - KeyHash *string `json:"keyHash,omitempty"` - Delegate *url.URL `json:"delegate,omitempty"` + KeyHash *string `json:"keyHash,omitempty"` + Delegate *url.URL `json:"delegate,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.KeyHash = encoding.BytesToJSON(v.KeyHash) u.Delegate = v.Delegate - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if x, err := encoding.BytesFromJSON(u.KeyHash); err != nil { @@ -21706,6 +22114,10 @@ func (v *KeySpecParams) UnmarshalJSON(data []byte) error { v.KeyHash = x } v.Delegate = u.Delegate + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21719,6 +22131,7 @@ func (v *LegacyED25519Signature) UnmarshalJSON(data []byte) error { SignerVersion uint64 `json:"signerVersion,omitempty"` Vote VoteType `json:"vote,omitempty"` TransactionHash *string `json:"transactionHash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Timestamp = v.Timestamp @@ -21728,7 +22141,8 @@ func (v *LegacyED25519Signature) UnmarshalJSON(data []byte) error { u.SignerVersion = v.SignerVersion u.Vote = v.Vote u.TransactionHash = encoding.ChainToJSON(&v.TransactionHash) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -21753,23 +22167,33 @@ func (v *LegacyED25519Signature) UnmarshalJSON(data []byte) error { } else { v.TransactionHash = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *LiteDataAccount) UnmarshalJSON(data []byte) error { u := struct { - Type AccountType `json:"type"` - Url *url.URL `json:"url,omitempty"` + Type AccountType `json:"type"` + Url *url.URL `json:"url,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Url = u.Url + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21779,12 +22203,14 @@ func (v *LiteIdentity) UnmarshalJSON(data []byte) error { Url *url.URL `json:"url,omitempty"` CreditBalance uint64 `json:"creditBalance,omitempty"` LastUsedOn uint64 `json:"lastUsedOn,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url u.CreditBalance = v.CreditBalance u.LastUsedOn = v.LastUsedOn - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -21793,6 +22219,10 @@ func (v *LiteIdentity) UnmarshalJSON(data []byte) error { v.Url = u.Url v.CreditBalance = u.CreditBalance v.LastUsedOn = u.LastUsedOn + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21803,13 +22233,15 @@ func (v *LiteTokenAccount) UnmarshalJSON(data []byte) error { TokenUrl *url.URL `json:"tokenUrl,omitempty"` Balance *string `json:"balance,omitempty"` LockHeight uint64 `json:"lockHeight,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url u.TokenUrl = v.TokenUrl u.Balance = encoding.BigintToJSON(&v.Balance) u.LockHeight = v.LockHeight - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -21823,34 +22255,46 @@ func (v *LiteTokenAccount) UnmarshalJSON(data []byte) error { v.Balance = *x } v.LockHeight = u.LockHeight + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *LockAccount) UnmarshalJSON(data []byte) error { u := struct { - Type TransactionType `json:"type"` - Height uint64 `json:"height,omitempty"` + Type TransactionType `json:"type"` + Height uint64 `json:"height,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Height = v.Height - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Height = u.Height + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *MetricsRequest) UnmarshalJSON(data []byte) error { u := struct { - Metric string `json:"metric,omitempty"` - Duration interface{} `json:"duration,omitempty"` + Metric string `json:"metric,omitempty"` + Duration interface{} `json:"duration,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Metric = v.Metric u.Duration = encoding.DurationToJSON(v.Duration) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Metric = u.Metric @@ -21859,6 +22303,10 @@ func (v *MetricsRequest) UnmarshalJSON(data []byte) error { } else { v.Duration = x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21867,7 +22315,8 @@ func (v *MetricsResponse) UnmarshalJSON(data []byte) error { Value interface{} `json:"value,omitempty"` }{} u.Value = encoding.AnyToJSON(v.Value) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if x, err := encoding.AnyFromJSON(u.Value); err != nil { @@ -21880,12 +22329,14 @@ func (v *MetricsResponse) UnmarshalJSON(data []byte) error { func (v *NetworkAccountUpdate) UnmarshalJSON(data []byte) error { u := struct { - Name string `json:"name,omitempty"` - Body *encoding.JsonUnmarshalWith[TransactionBody] `json:"body,omitempty"` + Name string `json:"name,omitempty"` + Body *encoding.JsonUnmarshalWith[TransactionBody] `json:"body,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Name = v.Name u.Body = &encoding.JsonUnmarshalWith[TransactionBody]{Value: v.Body, Func: UnmarshalTransactionBodyJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Name = u.Name @@ -21893,6 +22344,10 @@ func (v *NetworkAccountUpdate) UnmarshalJSON(data []byte) error { v.Body = u.Body.Value } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21902,18 +22357,24 @@ func (v *NetworkDefinition) UnmarshalJSON(data []byte) error { Version uint64 `json:"version,omitempty"` Partitions encoding.JsonList[*PartitionInfo] `json:"partitions,omitempty"` Validators encoding.JsonList[*ValidatorInfo] `json:"validators,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.NetworkName = v.NetworkName u.Version = v.Version u.Partitions = v.Partitions u.Validators = v.Validators - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.NetworkName = u.NetworkName v.Version = u.Version v.Partitions = u.Partitions v.Validators = u.Validators + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21921,10 +22382,12 @@ func (v *NetworkMaintenance) UnmarshalJSON(data []byte) error { u := struct { Type TransactionType `json:"type"` Operations *encoding.JsonUnmarshalListWith[NetworkMaintenanceOperation] `json:"operations,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Operations = &encoding.JsonUnmarshalListWith[NetworkMaintenanceOperation]{Value: v.Operations, Func: UnmarshalNetworkMaintenanceOperationJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -21936,24 +22399,34 @@ func (v *NetworkMaintenance) UnmarshalJSON(data []byte) error { v.Operations[i] = x } } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *Object) UnmarshalJSON(data []byte) error { u := struct { - Type ObjectType `json:"type,omitempty"` - Chains encoding.JsonList[ChainMetadata] `json:"chains,omitempty"` - Pending TxIdSet `json:"pending,omitempty"` + Type ObjectType `json:"type,omitempty"` + Chains encoding.JsonList[ChainMetadata] `json:"chains,omitempty"` + Pending TxIdSet `json:"pending,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type u.Chains = v.Chains u.Pending = v.Pending - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Type = u.Type v.Chains = u.Chains v.Pending = u.Pending + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21965,6 +22438,7 @@ func (v *PartitionAnchor) UnmarshalJSON(data []byte) error { RootChainIndex uint64 `json:"rootChainIndex,omitempty"` RootChainAnchor *string `json:"rootChainAnchor,omitempty"` StateTreeAnchor *string `json:"stateTreeAnchor,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Source = v.Source u.MajorBlockIndex = v.MajorBlockIndex @@ -21972,7 +22446,8 @@ func (v *PartitionAnchor) UnmarshalJSON(data []byte) error { u.RootChainIndex = v.RootChainIndex u.RootChainAnchor = encoding.ChainToJSON(&v.RootChainAnchor) u.StateTreeAnchor = encoding.ChainToJSON(&v.StateTreeAnchor) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Source = u.Source @@ -21989,6 +22464,10 @@ func (v *PartitionAnchor) UnmarshalJSON(data []byte) error { } else { v.StateTreeAnchor = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -21999,13 +22478,15 @@ func (v *PartitionSignature) UnmarshalJSON(data []byte) error { DestinationNetwork *url.URL `json:"destinationNetwork,omitempty"` SequenceNumber uint64 `json:"sequenceNumber,omitempty"` TransactionHash *string `json:"transactionHash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.SourceNetwork = v.SourceNetwork u.DestinationNetwork = v.DestinationNetwork u.SequenceNumber = v.SequenceNumber u.TransactionHash = encoding.ChainToJSON(&v.TransactionHash) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -22019,6 +22500,10 @@ func (v *PartitionSignature) UnmarshalJSON(data []byte) error { } else { v.TransactionHash = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22029,13 +22514,15 @@ func (v *PartitionSyntheticLedger) UnmarshalJSON(data []byte) error { Received uint64 `json:"received,omitempty"` Delivered uint64 `json:"delivered,omitempty"` Pending encoding.JsonList[*url.TxID] `json:"pending,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Url = v.Url u.Produced = v.Produced u.Received = v.Received u.Delivered = v.Delivered u.Pending = v.Pending - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Url = u.Url @@ -22043,23 +22530,33 @@ func (v *PartitionSyntheticLedger) UnmarshalJSON(data []byte) error { v.Received = u.Received v.Delivered = u.Delivered v.Pending = u.Pending + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *PendingTransactionGCOperation) UnmarshalJSON(data []byte) error { u := struct { - Type NetworkMaintenanceOperationType `json:"type"` - Account *url.URL `json:"account,omitempty"` + Type NetworkMaintenanceOperationType `json:"type"` + Account *url.URL `json:"account,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Account = v.Account - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Account = u.Account + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22075,6 +22572,7 @@ func (v *RCD1Signature) UnmarshalJSON(data []byte) error { TransactionHash *string `json:"transactionHash,omitempty"` Memo string `json:"memo,omitempty"` Data *string `json:"data,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.PublicKey = encoding.BytesToJSON(v.PublicKey) @@ -22086,7 +22584,8 @@ func (v *RCD1Signature) UnmarshalJSON(data []byte) error { u.TransactionHash = encoding.ChainToJSON(&v.TransactionHash) u.Memo = v.Memo u.Data = encoding.BytesToJSON(v.Data) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -22117,6 +22616,10 @@ func (v *RCD1Signature) UnmarshalJSON(data []byte) error { } else { v.Data = x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22126,12 +22629,14 @@ func (v *ReceiptSignature) UnmarshalJSON(data []byte) error { SourceNetwork *url.URL `json:"sourceNetwork,omitempty"` Proof merkle.Receipt `json:"proof,omitempty"` TransactionHash *string `json:"transactionHash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.SourceNetwork = v.SourceNetwork u.Proof = v.Proof u.TransactionHash = encoding.ChainToJSON(&v.TransactionHash) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -22144,6 +22649,10 @@ func (v *ReceiptSignature) UnmarshalJSON(data []byte) error { } else { v.TransactionHash = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22153,6 +22662,7 @@ func (v *RemoteSignature) UnmarshalJSON(data []byte) error { Destination *url.URL `json:"destination,omitempty"` Signature *encoding.JsonUnmarshalWith[Signature] `json:"signature,omitempty"` Cause encoding.JsonList[*string] `json:"cause,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Destination = v.Destination @@ -22161,7 +22671,8 @@ func (v *RemoteSignature) UnmarshalJSON(data []byte) error { for i, x := range v.Cause { u.Cause[i] = encoding.ChainToJSON(&x) } - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -22180,17 +22691,23 @@ func (v *RemoteSignature) UnmarshalJSON(data []byte) error { v.Cause[i] = *x } } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *RemoteTransaction) UnmarshalJSON(data []byte) error { u := struct { - Type TransactionType `json:"type"` - Hash *string `json:"hash,omitempty"` + Type TransactionType `json:"type"` + Hash *string `json:"hash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Hash = encoding.ChainToJSON(&v.Hash) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -22201,6 +22718,10 @@ func (v *RemoteTransaction) UnmarshalJSON(data []byte) error { } else { v.Hash = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22208,33 +22729,45 @@ func (v *RemoveAccountAuthorityOperation) UnmarshalJSON(data []byte) error { u := struct { Type AccountAuthOperationType `json:"type"` Authority *url.URL `json:"authority,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Authority = v.Authority - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Authority = u.Authority + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *RemoveKeyOperation) UnmarshalJSON(data []byte) error { u := struct { - Type KeyPageOperationType `json:"type"` - Entry KeySpecParams `json:"entry,omitempty"` + Type KeyPageOperationType `json:"type"` + Entry KeySpecParams `json:"entry,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Entry = v.Entry - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Entry = u.Entry + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22242,14 +22775,20 @@ func (v *RoutingTable) UnmarshalJSON(data []byte) error { u := struct { Overrides encoding.JsonList[RouteOverride] `json:"overrides,omitempty"` Routes encoding.JsonList[Route] `json:"routes,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Overrides = v.Overrides u.Routes = v.Routes - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Overrides = u.Overrides v.Routes = u.Routes + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22265,6 +22804,7 @@ func (v *RsaSha256Signature) UnmarshalJSON(data []byte) error { TransactionHash *string `json:"transactionHash,omitempty"` Memo string `json:"memo,omitempty"` Data *string `json:"data,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.PublicKey = encoding.BytesToJSON(v.PublicKey) @@ -22276,7 +22816,8 @@ func (v *RsaSha256Signature) UnmarshalJSON(data []byte) error { u.TransactionHash = encoding.ChainToJSON(&v.TransactionHash) u.Memo = v.Memo u.Data = encoding.BytesToJSON(v.Data) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -22307,21 +22848,27 @@ func (v *RsaSha256Signature) UnmarshalJSON(data []byte) error { } else { v.Data = x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *SendTokens) UnmarshalJSON(data []byte) error { u := struct { - Type TransactionType `json:"type"` - Hash *string `json:"hash,omitempty"` - Meta json.RawMessage `json:"meta,omitempty"` - To encoding.JsonList[*TokenRecipient] `json:"to,omitempty"` + Type TransactionType `json:"type"` + Hash *string `json:"hash,omitempty"` + Meta json.RawMessage `json:"meta,omitempty"` + To encoding.JsonList[*TokenRecipient] `json:"to,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Hash = encoding.ChainToJSON(&v.Hash) u.Meta = v.Meta u.To = v.To - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -22334,6 +22881,10 @@ func (v *SendTokens) UnmarshalJSON(data []byte) error { } v.Meta = u.Meta v.To = u.To + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22341,16 +22892,22 @@ func (v *SetRejectThresholdKeyPageOperation) UnmarshalJSON(data []byte) error { u := struct { Type KeyPageOperationType `json:"type"` Threshold uint64 `json:"threshold,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Threshold = v.Threshold - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Threshold = u.Threshold + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22358,16 +22915,22 @@ func (v *SetResponseThresholdKeyPageOperation) UnmarshalJSON(data []byte) error u := struct { Type KeyPageOperationType `json:"type"` Threshold uint64 `json:"threshold,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Threshold = v.Threshold - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Threshold = u.Threshold + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22375,16 +22938,22 @@ func (v *SetThresholdKeyPageOperation) UnmarshalJSON(data []byte) error { u := struct { Type KeyPageOperationType `json:"type"` Threshold uint64 `json:"threshold,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Threshold = v.Threshold - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Threshold = u.Threshold + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22396,6 +22965,7 @@ func (v *SignatureSet) UnmarshalJSON(data []byte) error { TransactionHash *string `json:"transactionHash,omitempty"` Signatures *encoding.JsonUnmarshalListWith[Signature] `json:"signatures,omitempty"` Authority *url.URL `json:"authority,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Vote = v.Vote @@ -22403,7 +22973,8 @@ func (v *SignatureSet) UnmarshalJSON(data []byte) error { u.TransactionHash = encoding.ChainToJSON(&v.TransactionHash) u.Signatures = &encoding.JsonUnmarshalListWith[Signature]{Value: v.Signatures, Func: UnmarshalSignatureJSON} u.Authority = v.Authority - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -22423,6 +22994,10 @@ func (v *SignatureSet) UnmarshalJSON(data []byte) error { } } v.Authority = u.Authority + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22436,6 +23011,7 @@ func (v *SyntheticBurnTokens) UnmarshalJSON(data []byte) error { Index uint64 `json:"index,omitempty"` Amount *string `json:"amount,omitempty"` IsRefund bool `json:"isRefund,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Cause = v.SyntheticOrigin.Cause @@ -22445,7 +23021,8 @@ func (v *SyntheticBurnTokens) UnmarshalJSON(data []byte) error { u.Index = v.SyntheticOrigin.Index u.Amount = encoding.BigintToJSON(&v.Amount) u.IsRefund = v.IsRefund - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -22461,6 +23038,10 @@ func (v *SyntheticBurnTokens) UnmarshalJSON(data []byte) error { v.Amount = *x } v.IsRefund = u.IsRefund + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22473,6 +23054,7 @@ func (v *SyntheticCreateIdentity) UnmarshalJSON(data []byte) error { FeeRefund uint64 `json:"feeRefund,omitempty"` Index uint64 `json:"index,omitempty"` Accounts *encoding.JsonUnmarshalListWith[Account] `json:"accounts,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Cause = v.SyntheticOrigin.Cause @@ -22481,7 +23063,8 @@ func (v *SyntheticCreateIdentity) UnmarshalJSON(data []byte) error { u.FeeRefund = v.SyntheticOrigin.FeeRefund u.Index = v.SyntheticOrigin.Index u.Accounts = &encoding.JsonUnmarshalListWith[Account]{Value: v.Accounts, Func: UnmarshalAccountJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -22497,6 +23080,10 @@ func (v *SyntheticCreateIdentity) UnmarshalJSON(data []byte) error { v.Accounts[i] = x } } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22511,6 +23098,7 @@ func (v *SyntheticDepositCredits) UnmarshalJSON(data []byte) error { Amount uint64 `json:"amount,omitempty"` AcmeRefundAmount *string `json:"acmeRefundAmount,omitempty"` IsRefund bool `json:"isRefund,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Cause = v.SyntheticOrigin.Cause @@ -22521,7 +23109,8 @@ func (v *SyntheticDepositCredits) UnmarshalJSON(data []byte) error { u.Amount = v.Amount u.AcmeRefundAmount = encoding.BigintToJSON(v.AcmeRefundAmount) u.IsRefund = v.IsRefund - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -22540,6 +23129,10 @@ func (v *SyntheticDepositCredits) UnmarshalJSON(data []byte) error { } } v.IsRefund = u.IsRefund + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22555,6 +23148,7 @@ func (v *SyntheticDepositTokens) UnmarshalJSON(data []byte) error { Amount *string `json:"amount,omitempty"` IsIssuer bool `json:"isIssuer,omitempty"` IsRefund bool `json:"isRefund,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Cause = v.SyntheticOrigin.Cause @@ -22566,7 +23160,8 @@ func (v *SyntheticDepositTokens) UnmarshalJSON(data []byte) error { u.Amount = encoding.BigintToJSON(&v.Amount) u.IsIssuer = v.IsIssuer u.IsRefund = v.IsRefund - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -22584,6 +23179,10 @@ func (v *SyntheticDepositTokens) UnmarshalJSON(data []byte) error { } v.IsIssuer = u.IsIssuer v.IsRefund = u.IsRefund + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22592,11 +23191,13 @@ func (v *SyntheticForwardTransaction) UnmarshalJSON(data []byte) error { Type TransactionType `json:"type"` Signatures encoding.JsonList[RemoteSignature] `json:"signatures,omitempty"` Transaction *Transaction `json:"transaction,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Signatures = v.Signatures u.Transaction = v.Transaction - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -22604,19 +23205,25 @@ func (v *SyntheticForwardTransaction) UnmarshalJSON(data []byte) error { } v.Signatures = u.Signatures v.Transaction = u.Transaction + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *SyntheticLedger) UnmarshalJSON(data []byte) error { u := struct { - Type AccountType `json:"type"` - Url *url.URL `json:"url,omitempty"` - Sequence encoding.JsonList[*PartitionSyntheticLedger] `json:"sequence,omitempty"` + Type AccountType `json:"type"` + Url *url.URL `json:"url,omitempty"` + Sequence encoding.JsonList[*PartitionSyntheticLedger] `json:"sequence,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url u.Sequence = v.Sequence - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -22624,6 +23231,10 @@ func (v *SyntheticLedger) UnmarshalJSON(data []byte) error { } v.Url = u.Url v.Sequence = u.Sequence + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22636,6 +23247,7 @@ func (v *SyntheticWriteData) UnmarshalJSON(data []byte) error { FeeRefund uint64 `json:"feeRefund,omitempty"` Index uint64 `json:"index,omitempty"` Entry *encoding.JsonUnmarshalWith[DataEntry] `json:"entry,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Cause = v.SyntheticOrigin.Cause @@ -22644,7 +23256,8 @@ func (v *SyntheticWriteData) UnmarshalJSON(data []byte) error { u.FeeRefund = v.SyntheticOrigin.FeeRefund u.Index = v.SyntheticOrigin.Index u.Entry = &encoding.JsonUnmarshalWith[DataEntry]{Value: v.Entry, Func: UnmarshalDataEntryJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -22658,20 +23271,30 @@ func (v *SyntheticWriteData) UnmarshalJSON(data []byte) error { v.Entry = u.Entry.Value } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *SystemGenesis) UnmarshalJSON(data []byte) error { u := struct { - Type TransactionType `json:"type"` + Type TransactionType `json:"type"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22686,6 +23309,7 @@ func (v *SystemLedger) UnmarshalJSON(data []byte) error { Anchor *encoding.JsonUnmarshalWith[AnchorBody] `json:"anchor,omitempty"` ExecutorVersion ExecutorVersion `json:"executorVersion,omitempty"` BvnExecutorVersions encoding.JsonList[*PartitionExecutorVersion] `json:"bvnExecutorVersions,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url @@ -22696,7 +23320,8 @@ func (v *SystemLedger) UnmarshalJSON(data []byte) error { u.Anchor = &encoding.JsonUnmarshalWith[AnchorBody]{Value: v.Anchor, Func: UnmarshalAnchorBodyJSON} u.ExecutorVersion = v.ExecutorVersion u.BvnExecutorVersions = v.BvnExecutorVersions - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -22717,6 +23342,10 @@ func (v *SystemLedger) UnmarshalJSON(data []byte) error { v.ExecutorVersion = u.ExecutorVersion v.BvnExecutorVersions = u.BvnExecutorVersions + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22725,11 +23354,13 @@ func (v *SystemWriteData) UnmarshalJSON(data []byte) error { Type TransactionType `json:"type"` Entry *encoding.JsonUnmarshalWith[DataEntry] `json:"entry,omitempty"` WriteToState bool `json:"writeToState,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Entry = &encoding.JsonUnmarshalWith[DataEntry]{Value: v.Entry, Func: UnmarshalDataEntryJSON} u.WriteToState = v.WriteToState - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -22740,6 +23371,10 @@ func (v *SystemWriteData) UnmarshalJSON(data []byte) error { } v.WriteToState = u.WriteToState + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22750,13 +23385,15 @@ func (v *TokenAccount) UnmarshalJSON(data []byte) error { Authorities encoding.JsonList[AuthorityEntry] `json:"authorities,omitempty"` TokenUrl *url.URL `json:"tokenUrl,omitempty"` Balance *string `json:"balance,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url u.Authorities = v.AccountAuth.Authorities u.TokenUrl = v.TokenUrl u.Balance = encoding.BigintToJSON(&v.Balance) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -22770,6 +23407,10 @@ func (v *TokenAccount) UnmarshalJSON(data []byte) error { } else { v.Balance = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22783,6 +23424,7 @@ func (v *TokenIssuer) UnmarshalJSON(data []byte) error { Properties *url.URL `json:"properties,omitempty"` Issued *string `json:"issued,omitempty"` SupplyLimit *string `json:"supplyLimit,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url @@ -22792,7 +23434,8 @@ func (v *TokenIssuer) UnmarshalJSON(data []byte) error { u.Properties = v.Properties u.Issued = encoding.BigintToJSON(&v.Issued) u.SupplyLimit = encoding.BigintToJSON(v.SupplyLimit) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -22815,17 +23458,23 @@ func (v *TokenIssuer) UnmarshalJSON(data []byte) error { v.SupplyLimit = x } } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *TokenRecipient) UnmarshalJSON(data []byte) error { u := struct { - Url *url.URL `json:"url,omitempty"` - Amount *string `json:"amount,omitempty"` + Url *url.URL `json:"url,omitempty"` + Amount *string `json:"amount,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Url = v.Url u.Amount = encoding.BigintToJSON(&v.Amount) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Url = u.Url @@ -22834,17 +23483,24 @@ func (v *TokenRecipient) UnmarshalJSON(data []byte) error { } else { v.Amount = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *Transaction) UnmarshalJSON(data []byte) error { u := struct { - Header TransactionHeader `json:"header,omitempty"` - Body *encoding.JsonUnmarshalWith[TransactionBody] `json:"body,omitempty"` + Header TransactionHeader `json:"header,omitempty"` + Body *encoding.JsonUnmarshalWith[TransactionBody] `json:"body,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Header = v.Header u.Body = &encoding.JsonUnmarshalWith[TransactionBody]{Value: v.Body, Func: UnmarshalTransactionBodyJSON} - if err := json.Unmarshal(data, &u); err != nil { + + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Header = u.Header @@ -22852,6 +23508,10 @@ func (v *Transaction) UnmarshalJSON(data []byte) error { v.Body = u.Body.Value } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22864,6 +23524,7 @@ func (v *TransactionHeader) UnmarshalJSON(data []byte) error { Expire *ExpireOptions `json:"expire,omitempty"` HoldUntil *HoldUntilOptions `json:"holdUntil,omitempty"` Authorities encoding.JsonList[*url.URL] `json:"authorities,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Principal = v.Principal u.Initiator = encoding.ChainToJSON(&v.Initiator) @@ -22872,7 +23533,8 @@ func (v *TransactionHeader) UnmarshalJSON(data []byte) error { u.Expire = v.Expire u.HoldUntil = v.HoldUntil u.Authorities = v.Authorities - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Principal = u.Principal @@ -22890,18 +23552,28 @@ func (v *TransactionHeader) UnmarshalJSON(data []byte) error { v.Expire = u.Expire v.HoldUntil = u.HoldUntil v.Authorities = u.Authorities + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *TransactionResultSet) UnmarshalJSON(data []byte) error { u := struct { - Results encoding.JsonList[*TransactionStatus] `json:"results,omitempty"` + Results encoding.JsonList[*TransactionStatus] `json:"results,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Results = v.Results - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Results = u.Results + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -22925,6 +23597,7 @@ func (v *TransactionStatus) UnmarshalJSON(data []byte) error { GotDirectoryReceipt bool `json:"gotDirectoryReceipt,omitempty"` Proof *merkle.Receipt `json:"proof,omitempty"` AnchorSigners encoding.JsonList[*string] `json:"anchorSigners,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.TxID = v.TxID u.Code = v.Code @@ -22947,7 +23620,8 @@ func (v *TransactionStatus) UnmarshalJSON(data []byte) error { for i, x := range v.AnchorSigners { u.AnchorSigners[i] = encoding.BytesToJSON(x) } - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.TxID = u.TxID @@ -22978,65 +23652,89 @@ func (v *TransactionStatus) UnmarshalJSON(data []byte) error { v.AnchorSigners[i] = x } } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *TransferCredits) UnmarshalJSON(data []byte) error { u := struct { - Type TransactionType `json:"type"` - To encoding.JsonList[*CreditRecipient] `json:"to,omitempty"` + Type TransactionType `json:"type"` + To encoding.JsonList[*CreditRecipient] `json:"to,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.To = v.To - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.To = u.To + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *TxIdSet) UnmarshalJSON(data []byte) error { u := struct { - Entries encoding.JsonList[*url.TxID] `json:"entries,omitempty"` + Entries encoding.JsonList[*url.TxID] `json:"entries,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Entries = v.Entries - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Entries = u.Entries + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *UnknownAccount) UnmarshalJSON(data []byte) error { u := struct { - Type AccountType `json:"type"` - Url *url.URL `json:"url,omitempty"` + Type AccountType `json:"type"` + Url *url.URL `json:"url,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Url = u.Url + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *UnknownSigner) UnmarshalJSON(data []byte) error { u := struct { - Type AccountType `json:"type"` - Url *url.URL `json:"url,omitempty"` - Version uint64 `json:"version,omitempty"` + Type AccountType `json:"type"` + Url *url.URL `json:"url,omitempty"` + Version uint64 `json:"version,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Url = v.Url u.Version = v.Version - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -23044,6 +23742,10 @@ func (v *UnknownSigner) UnmarshalJSON(data []byte) error { } v.Url = u.Url v.Version = u.Version + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -23051,10 +23753,12 @@ func (v *UpdateAccountAuth) UnmarshalJSON(data []byte) error { u := struct { Type TransactionType `json:"type"` Operations *encoding.JsonUnmarshalListWith[AccountAuthOperation] `json:"operations,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Operations = &encoding.JsonUnmarshalListWith[AccountAuthOperation]{Value: v.Operations, Func: UnmarshalAccountAuthOperationJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -23066,19 +23770,25 @@ func (v *UpdateAccountAuth) UnmarshalJSON(data []byte) error { v.Operations[i] = x } } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *UpdateAllowedKeyPageOperation) UnmarshalJSON(data []byte) error { u := struct { - Type KeyPageOperationType `json:"type"` - Allow encoding.JsonList[TransactionType] `json:"allow,omitempty"` - Deny encoding.JsonList[TransactionType] `json:"deny,omitempty"` + Type KeyPageOperationType `json:"type"` + Allow encoding.JsonList[TransactionType] `json:"allow,omitempty"` + Deny encoding.JsonList[TransactionType] `json:"deny,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Allow = v.Allow u.Deny = v.Deny - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -23086,6 +23796,10 @@ func (v *UpdateAllowedKeyPageOperation) UnmarshalJSON(data []byte) error { } v.Allow = u.Allow v.Deny = u.Deny + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -23093,10 +23807,12 @@ func (v *UpdateKey) UnmarshalJSON(data []byte) error { u := struct { Type TransactionType `json:"type"` NewKeyHash *string `json:"newKeyHash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.NewKeyHash = encoding.BytesToJSON(v.NewKeyHash) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -23107,19 +23823,25 @@ func (v *UpdateKey) UnmarshalJSON(data []byte) error { } else { v.NewKeyHash = x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *UpdateKeyOperation) UnmarshalJSON(data []byte) error { u := struct { - Type KeyPageOperationType `json:"type"` - OldEntry KeySpecParams `json:"oldEntry,omitempty"` - NewEntry KeySpecParams `json:"newEntry,omitempty"` + Type KeyPageOperationType `json:"type"` + OldEntry KeySpecParams `json:"oldEntry,omitempty"` + NewEntry KeySpecParams `json:"newEntry,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.OldEntry = v.OldEntry u.NewEntry = v.NewEntry - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -23127,6 +23849,10 @@ func (v *UpdateKeyOperation) UnmarshalJSON(data []byte) error { } v.OldEntry = u.OldEntry v.NewEntry = u.NewEntry + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -23134,10 +23860,12 @@ func (v *UpdateKeyPage) UnmarshalJSON(data []byte) error { u := struct { Type TransactionType `json:"type"` Operation *encoding.JsonUnmarshalListWith[KeyPageOperation] `json:"operation,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Operation = &encoding.JsonUnmarshalListWith[KeyPageOperation]{Value: v.Operation, Func: UnmarshalKeyPageOperationJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -23149,6 +23877,10 @@ func (v *UpdateKeyPage) UnmarshalJSON(data []byte) error { v.Operation[i] = x } } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -23158,12 +23890,14 @@ func (v *ValidatorInfo) UnmarshalJSON(data []byte) error { PublicKeyHash *string `json:"publicKeyHash,omitempty"` Operator *url.URL `json:"operator,omitempty"` Partitions encoding.JsonList[*ValidatorPartitionInfo] `json:"partitions,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.PublicKey = encoding.BytesToJSON(v.PublicKey) u.PublicKeyHash = encoding.ChainToJSON(&v.PublicKeyHash) u.Operator = v.Operator u.Partitions = v.Partitions - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if x, err := encoding.BytesFromJSON(u.PublicKey); err != nil { @@ -23178,6 +23912,10 @@ func (v *ValidatorInfo) UnmarshalJSON(data []byte) error { } v.Operator = u.Operator v.Partitions = u.Partitions + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -23187,12 +23925,14 @@ func (v *WriteData) UnmarshalJSON(data []byte) error { Entry *encoding.JsonUnmarshalWith[DataEntry] `json:"entry,omitempty"` Scratch bool `json:"scratch,omitempty"` WriteToState bool `json:"writeToState,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Entry = &encoding.JsonUnmarshalWith[DataEntry]{Value: v.Entry, Func: UnmarshalDataEntryJSON} u.Scratch = v.Scratch u.WriteToState = v.WriteToState - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -23204,6 +23944,10 @@ func (v *WriteData) UnmarshalJSON(data []byte) error { v.Scratch = u.Scratch v.WriteToState = u.WriteToState + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -23213,12 +23957,14 @@ func (v *WriteDataResult) UnmarshalJSON(data []byte) error { EntryHash *string `json:"entryHash,omitempty"` AccountUrl *url.URL `json:"accountUrl,omitempty"` AccountID *string `json:"accountID,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.EntryHash = encoding.ChainToJSON(&v.EntryHash) u.AccountUrl = v.AccountUrl u.AccountID = encoding.BytesToJSON(v.AccountID) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -23235,6 +23981,10 @@ func (v *WriteDataResult) UnmarshalJSON(data []byte) error { } else { v.AccountID = x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -23243,11 +23993,13 @@ func (v *WriteDataTo) UnmarshalJSON(data []byte) error { Type TransactionType `json:"type"` Recipient *url.URL `json:"recipient,omitempty"` Entry *encoding.JsonUnmarshalWith[DataEntry] `json:"entry,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Recipient = v.Recipient u.Entry = &encoding.JsonUnmarshalWith[DataEntry]{Value: v.Entry, Func: UnmarshalDataEntryJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -23258,5 +24010,9 @@ func (v *WriteDataTo) UnmarshalJSON(data []byte) error { v.Entry = u.Entry.Value } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } diff --git a/test/encoding/types_gen.go b/test/encoding/types_gen.go index ef1cdfd1a..72a562da2 100644 --- a/test/encoding/types_gen.go +++ b/test/encoding/types_gen.go @@ -261,6 +261,7 @@ func (v *Signature) MarshalJSON() ([]byte, error) { u := struct { Txid *url.TxID `json:"txid,omitempty"` Signature *encoding.JsonUnmarshalWith[protocol.Signature] `json:"signature,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Txid == nil) { u.Txid = v.Txid @@ -268,16 +269,19 @@ func (v *Signature) MarshalJSON() ([]byte, error) { if !(protocol.EqualSignature(v.Signature, nil)) { u.Signature = &encoding.JsonUnmarshalWith[protocol.Signature]{Value: v.Signature, Func: protocol.UnmarshalSignatureJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *sigSection) MarshalJSON() ([]byte, error) { u := struct { Signatures encoding.JsonList[*Signature] `json:"signatures,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Signatures) == 0) { u.Signatures = v.Signatures } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -285,10 +289,12 @@ func (v *Signature) UnmarshalJSON(data []byte) error { u := struct { Txid *url.TxID `json:"txid,omitempty"` Signature *encoding.JsonUnmarshalWith[protocol.Signature] `json:"signature,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Txid = v.Txid u.Signature = &encoding.JsonUnmarshalWith[protocol.Signature]{Value: v.Signature, Func: protocol.UnmarshalSignatureJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Txid = u.Txid @@ -296,17 +302,27 @@ func (v *Signature) UnmarshalJSON(data []byte) error { v.Signature = u.Signature.Value } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *sigSection) UnmarshalJSON(data []byte) error { u := struct { Signatures encoding.JsonList[*Signature] `json:"signatures,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Signatures = v.Signatures - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Signatures = u.Signatures + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } diff --git a/test/simulator/consensus/types_gen.go b/test/simulator/consensus/types_gen.go index e5c83de48..605d21c2e 100644 --- a/test/simulator/consensus/types_gen.go +++ b/test/simulator/consensus/types_gen.go @@ -2024,9 +2024,9 @@ func (v *BlockProposal) MarshalJSON() ([]byte, error) { Index uint64 `json:"index,omitempty"` Time time.Time `json:"time,omitempty"` Envelopes encoding.JsonList[*messaging.Envelope] `json:"envelopes,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.LeaderProposal.Leader == ([32]byte{})) { - u.Leader = encoding.ChainToJSON(&v.LeaderProposal.Leader) } if !(v.Index == 0) { @@ -2038,6 +2038,7 @@ func (v *BlockProposal) MarshalJSON() ([]byte, error) { if !(len(v.Envelopes) == 0) { u.Envelopes = v.Envelopes } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2045,6 +2046,7 @@ func (v *BlockResults) MarshalJSON() ([]byte, error) { u := struct { MessageResults encoding.JsonList[*protocol.TransactionStatus] `json:"messageResults,omitempty"` ValidatorUpdates encoding.JsonList[*ValidatorUpdate] `json:"validatorUpdates,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.MessageResults) == 0) { u.MessageResults = v.MessageResults @@ -2052,36 +2054,42 @@ func (v *BlockResults) MarshalJSON() ([]byte, error) { if !(len(v.ValidatorUpdates) == 0) { u.ValidatorUpdates = v.ValidatorUpdates } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *CommitResult) MarshalJSON() ([]byte, error) { u := struct { - Hash *string `json:"hash,omitempty"` + Hash *string `json:"hash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Hash == ([32]byte{})) { u.Hash = encoding.ChainToJSON(&v.Hash) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *EnvelopeSubmitted) MarshalJSON() ([]byte, error) { u := struct { - Type messageType `json:"type"` - Results encoding.JsonList[*protocol.TransactionStatus] `json:"results,omitempty"` + Type messageType `json:"type"` + Results encoding.JsonList[*protocol.TransactionStatus] `json:"results,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.Results) == 0) { u.Results = v.Results } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *ExecutedBlock) MarshalJSON() ([]byte, error) { u := struct { - Type messageType `json:"type"` - Network string `json:"network,omitempty"` - Node *string `json:"node,omitempty"` + Type messageType `json:"type"` + Network string `json:"network,omitempty"` + Node *string `json:"node,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.Network) == 0) { @@ -2090,33 +2098,39 @@ func (v *ExecutedBlock) MarshalJSON() ([]byte, error) { if !(v.Node == ([32]byte{})) { u.Node = encoding.ChainToJSON(&v.Node) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *LeaderProposal) MarshalJSON() ([]byte, error) { u := struct { - Leader *string `json:"leader,omitempty"` + Leader *string `json:"leader,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Leader == ([32]byte{})) { u.Leader = encoding.ChainToJSON(&v.Leader) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *StartBlock) MarshalJSON() ([]byte, error) { u := struct { - Type messageType `json:"type"` + Type messageType `json:"type"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *SubmitEnvelope) MarshalJSON() ([]byte, error) { u := struct { - Type messageType `json:"type"` - Network string `json:"network,omitempty"` - Envelope *messaging.Envelope `json:"envelope,omitempty"` - Pretend bool `json:"pretend,omitempty"` + Type messageType `json:"type"` + Network string `json:"network,omitempty"` + Envelope *messaging.Envelope `json:"envelope,omitempty"` + Pretend bool `json:"pretend,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(len(v.Network) == 0) { @@ -2128,6 +2142,7 @@ func (v *SubmitEnvelope) MarshalJSON() ([]byte, error) { if !(!v.Pretend) { u.Pretend = v.Pretend } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2136,6 +2151,7 @@ func (v *ValidatorUpdate) MarshalJSON() ([]byte, error) { Type protocol.SignatureType `json:"type,omitempty"` PublicKey *string `json:"publicKey,omitempty"` Power int64 `json:"power,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Type == 0) { u.Type = v.Type @@ -2146,6 +2162,7 @@ func (v *ValidatorUpdate) MarshalJSON() ([]byte, error) { if !(v.Power == 0) { u.Power = v.Power } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2155,19 +2172,19 @@ func (v *acceptBlockProposal) MarshalJSON() ([]byte, error) { PubKeyHash *string `json:"pubKeyHash,omitempty"` Network string `json:"network,omitempty"` p proposeBlock `json:"p,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.baseNodeMessage.PubKeyHash == ([32]byte{})) { - u.PubKeyHash = encoding.ChainToJSON(&v.baseNodeMessage.PubKeyHash) } if !(len(v.baseNodeMessage.Network) == 0) { - u.Network = v.baseNodeMessage.Network } if !((v.p).Equal(new(proposeBlock))) { u.p = v.p } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2178,14 +2195,13 @@ func (v *acceptedSubmission) MarshalJSON() ([]byte, error) { Network string `json:"network,omitempty"` result EnvelopeSubmitted `json:"result,omitempty"` env *messaging.Envelope `json:"env,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.baseNodeMessage.PubKeyHash == ([32]byte{})) { - u.PubKeyHash = encoding.ChainToJSON(&v.baseNodeMessage.PubKeyHash) } if !(len(v.baseNodeMessage.Network) == 0) { - u.Network = v.baseNodeMessage.Network } if !((v.result).Equal(new(EnvelopeSubmitted))) { @@ -2194,6 +2210,7 @@ func (v *acceptedSubmission) MarshalJSON() ([]byte, error) { if !(v.env == nil) { u.env = v.env } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2201,6 +2218,7 @@ func (v *baseNodeMessage) MarshalJSON() ([]byte, error) { u := struct { PubKeyHash *string `json:"pubKeyHash,omitempty"` Network string `json:"network,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.PubKeyHash == ([32]byte{})) { u.PubKeyHash = encoding.ChainToJSON(&v.PubKeyHash) @@ -2208,6 +2226,7 @@ func (v *baseNodeMessage) MarshalJSON() ([]byte, error) { if !(len(v.Network) == 0) { u.Network = v.Network } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2217,19 +2236,19 @@ func (v *committedBlock) MarshalJSON() ([]byte, error) { PubKeyHash *string `json:"pubKeyHash,omitempty"` Network string `json:"network,omitempty"` results CommitResult `json:"results,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.baseNodeMessage.PubKeyHash == ([32]byte{})) { - u.PubKeyHash = encoding.ChainToJSON(&v.baseNodeMessage.PubKeyHash) } if !(len(v.baseNodeMessage.Network) == 0) { - u.Network = v.baseNodeMessage.Network } if !((v.results).Equal(new(CommitResult))) { u.results = v.results } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2239,19 +2258,19 @@ func (v *finalizedBlock) MarshalJSON() ([]byte, error) { PubKeyHash *string `json:"pubKeyHash,omitempty"` Network string `json:"network,omitempty"` results BlockResults `json:"results,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.baseNodeMessage.PubKeyHash == ([32]byte{})) { - u.PubKeyHash = encoding.ChainToJSON(&v.baseNodeMessage.PubKeyHash) } if !(len(v.baseNodeMessage.Network) == 0) { - u.Network = v.baseNodeMessage.Network } if !((v.results).Equal(new(BlockResults))) { u.results = v.results } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2264,32 +2283,28 @@ func (v *proposeBlock) MarshalJSON() ([]byte, error) { Index uint64 `json:"index,omitempty"` Time time.Time `json:"time,omitempty"` Envelopes encoding.JsonList[*messaging.Envelope] `json:"envelopes,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.baseNodeMessage.PubKeyHash == ([32]byte{})) { - u.PubKeyHash = encoding.ChainToJSON(&v.baseNodeMessage.PubKeyHash) } if !(len(v.baseNodeMessage.Network) == 0) { - u.Network = v.baseNodeMessage.Network } if !((v.BlockProposal.LeaderProposal).Equal(new(LeaderProposal))) { - u.LeaderProposal = v.BlockProposal.LeaderProposal } if !(v.BlockProposal.Index == 0) { - u.Index = v.BlockProposal.Index } if !(v.BlockProposal.Time == (time.Time{})) { - u.Time = v.BlockProposal.Time } if !(len(v.BlockProposal.Envelopes) == 0) { - u.Envelopes = v.BlockProposal.Envelopes } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2299,20 +2314,19 @@ func (v *proposeLeader) MarshalJSON() ([]byte, error) { PubKeyHash *string `json:"pubKeyHash,omitempty"` Network string `json:"network,omitempty"` Leader *string `json:"leader,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.baseNodeMessage.PubKeyHash == ([32]byte{})) { - u.PubKeyHash = encoding.ChainToJSON(&v.baseNodeMessage.PubKeyHash) } if !(len(v.baseNodeMessage.Network) == 0) { - u.Network = v.baseNodeMessage.Network } if !(v.LeaderProposal.Leader == ([32]byte{})) { - u.Leader = encoding.ChainToJSON(&v.LeaderProposal.Leader) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -2322,12 +2336,14 @@ func (v *BlockProposal) UnmarshalJSON(data []byte) error { Index uint64 `json:"index,omitempty"` Time time.Time `json:"time,omitempty"` Envelopes encoding.JsonList[*messaging.Envelope] `json:"envelopes,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Leader = encoding.ChainToJSON(&v.LeaderProposal.Leader) u.Index = v.Index u.Time = v.Time u.Envelopes = v.Envelopes - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if x, err := encoding.ChainFromJSON(u.Leader); err != nil { @@ -2338,6 +2354,10 @@ func (v *BlockProposal) UnmarshalJSON(data []byte) error { v.Index = u.Index v.Time = u.Time v.Envelopes = u.Envelopes + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -2345,23 +2365,31 @@ func (v *BlockResults) UnmarshalJSON(data []byte) error { u := struct { MessageResults encoding.JsonList[*protocol.TransactionStatus] `json:"messageResults,omitempty"` ValidatorUpdates encoding.JsonList[*ValidatorUpdate] `json:"validatorUpdates,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.MessageResults = v.MessageResults u.ValidatorUpdates = v.ValidatorUpdates - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.MessageResults = u.MessageResults v.ValidatorUpdates = u.ValidatorUpdates + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *CommitResult) UnmarshalJSON(data []byte) error { u := struct { - Hash *string `json:"hash,omitempty"` + Hash *string `json:"hash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Hash = encoding.ChainToJSON(&v.Hash) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if x, err := encoding.ChainFromJSON(u.Hash); err != nil { @@ -2369,36 +2397,48 @@ func (v *CommitResult) UnmarshalJSON(data []byte) error { } else { v.Hash = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *EnvelopeSubmitted) UnmarshalJSON(data []byte) error { u := struct { - Type messageType `json:"type"` - Results encoding.JsonList[*protocol.TransactionStatus] `json:"results,omitempty"` + Type messageType `json:"type"` + Results encoding.JsonList[*protocol.TransactionStatus] `json:"results,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Results = v.Results - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Results = u.Results + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *ExecutedBlock) UnmarshalJSON(data []byte) error { u := struct { - Type messageType `json:"type"` - Network string `json:"network,omitempty"` - Node *string `json:"node,omitempty"` + Type messageType `json:"type"` + Network string `json:"network,omitempty"` + Node *string `json:"node,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Network = v.Network u.Node = encoding.ChainToJSON(&v.Node) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2410,15 +2450,21 @@ func (v *ExecutedBlock) UnmarshalJSON(data []byte) error { } else { v.Node = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *LeaderProposal) UnmarshalJSON(data []byte) error { u := struct { - Leader *string `json:"leader,omitempty"` + Leader *string `json:"leader,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Leader = encoding.ChainToJSON(&v.Leader) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if x, err := encoding.ChainFromJSON(u.Leader); err != nil { @@ -2426,35 +2472,47 @@ func (v *LeaderProposal) UnmarshalJSON(data []byte) error { } else { v.Leader = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *StartBlock) UnmarshalJSON(data []byte) error { u := struct { - Type messageType `json:"type"` + Type messageType `json:"type"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *SubmitEnvelope) UnmarshalJSON(data []byte) error { u := struct { - Type messageType `json:"type"` - Network string `json:"network,omitempty"` - Envelope *messaging.Envelope `json:"envelope,omitempty"` - Pretend bool `json:"pretend,omitempty"` + Type messageType `json:"type"` + Network string `json:"network,omitempty"` + Envelope *messaging.Envelope `json:"envelope,omitempty"` + Pretend bool `json:"pretend,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Network = v.Network u.Envelope = v.Envelope u.Pretend = v.Pretend - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2463,6 +2521,10 @@ func (v *SubmitEnvelope) UnmarshalJSON(data []byte) error { v.Network = u.Network v.Envelope = u.Envelope v.Pretend = u.Pretend + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -2471,11 +2533,13 @@ func (v *ValidatorUpdate) UnmarshalJSON(data []byte) error { Type protocol.SignatureType `json:"type,omitempty"` PublicKey *string `json:"publicKey,omitempty"` Power int64 `json:"power,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type u.PublicKey = encoding.BytesToJSON(v.PublicKey) u.Power = v.Power - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Type = u.Type @@ -2485,6 +2549,10 @@ func (v *ValidatorUpdate) UnmarshalJSON(data []byte) error { v.PublicKey = x } v.Power = u.Power + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -2494,12 +2562,14 @@ func (v *acceptBlockProposal) UnmarshalJSON(data []byte) error { PubKeyHash *string `json:"pubKeyHash,omitempty"` Network string `json:"network,omitempty"` p proposeBlock `json:"p,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.PubKeyHash = encoding.ChainToJSON(&v.baseNodeMessage.PubKeyHash) u.Network = v.baseNodeMessage.Network u.p = v.p - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2512,6 +2582,10 @@ func (v *acceptBlockProposal) UnmarshalJSON(data []byte) error { } v.baseNodeMessage.Network = u.Network v.p = u.p + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -2522,13 +2596,15 @@ func (v *acceptedSubmission) UnmarshalJSON(data []byte) error { Network string `json:"network,omitempty"` result EnvelopeSubmitted `json:"result,omitempty"` env *messaging.Envelope `json:"env,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.PubKeyHash = encoding.ChainToJSON(&v.baseNodeMessage.PubKeyHash) u.Network = v.baseNodeMessage.Network u.result = v.result u.env = v.env - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2542,6 +2618,10 @@ func (v *acceptedSubmission) UnmarshalJSON(data []byte) error { v.baseNodeMessage.Network = u.Network v.result = u.result v.env = u.env + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -2549,10 +2629,12 @@ func (v *baseNodeMessage) UnmarshalJSON(data []byte) error { u := struct { PubKeyHash *string `json:"pubKeyHash,omitempty"` Network string `json:"network,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.PubKeyHash = encoding.ChainToJSON(&v.PubKeyHash) u.Network = v.Network - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if x, err := encoding.ChainFromJSON(u.PubKeyHash); err != nil { @@ -2561,6 +2643,10 @@ func (v *baseNodeMessage) UnmarshalJSON(data []byte) error { v.PubKeyHash = *x } v.Network = u.Network + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -2570,12 +2656,14 @@ func (v *committedBlock) UnmarshalJSON(data []byte) error { PubKeyHash *string `json:"pubKeyHash,omitempty"` Network string `json:"network,omitempty"` results CommitResult `json:"results,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.PubKeyHash = encoding.ChainToJSON(&v.baseNodeMessage.PubKeyHash) u.Network = v.baseNodeMessage.Network u.results = v.results - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2588,6 +2676,10 @@ func (v *committedBlock) UnmarshalJSON(data []byte) error { } v.baseNodeMessage.Network = u.Network v.results = u.results + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -2597,12 +2689,14 @@ func (v *finalizedBlock) UnmarshalJSON(data []byte) error { PubKeyHash *string `json:"pubKeyHash,omitempty"` Network string `json:"network,omitempty"` results BlockResults `json:"results,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.PubKeyHash = encoding.ChainToJSON(&v.baseNodeMessage.PubKeyHash) u.Network = v.baseNodeMessage.Network u.results = v.results - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2615,6 +2709,10 @@ func (v *finalizedBlock) UnmarshalJSON(data []byte) error { } v.baseNodeMessage.Network = u.Network v.results = u.results + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -2627,6 +2725,7 @@ func (v *proposeBlock) UnmarshalJSON(data []byte) error { Index uint64 `json:"index,omitempty"` Time time.Time `json:"time,omitempty"` Envelopes encoding.JsonList[*messaging.Envelope] `json:"envelopes,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.PubKeyHash = encoding.ChainToJSON(&v.baseNodeMessage.PubKeyHash) @@ -2635,7 +2734,8 @@ func (v *proposeBlock) UnmarshalJSON(data []byte) error { u.Index = v.BlockProposal.Index u.Time = v.BlockProposal.Time u.Envelopes = v.BlockProposal.Envelopes - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2651,6 +2751,10 @@ func (v *proposeBlock) UnmarshalJSON(data []byte) error { v.BlockProposal.Index = u.Index v.BlockProposal.Time = u.Time v.BlockProposal.Envelopes = u.Envelopes + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } @@ -2660,12 +2764,14 @@ func (v *proposeLeader) UnmarshalJSON(data []byte) error { PubKeyHash *string `json:"pubKeyHash,omitempty"` Network string `json:"network,omitempty"` Leader *string `json:"leader,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.PubKeyHash = encoding.ChainToJSON(&v.baseNodeMessage.PubKeyHash) u.Network = v.baseNodeMessage.Network u.Leader = encoding.ChainToJSON(&v.LeaderProposal.Leader) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -2682,5 +2788,9 @@ func (v *proposeLeader) UnmarshalJSON(data []byte) error { } else { v.LeaderProposal.Leader = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } diff --git a/test/simulator/recorder_types_gen.go b/test/simulator/recorder_types_gen.go index cf86da447..0d25a906a 100644 --- a/test/simulator/recorder_types_gen.go +++ b/test/simulator/recorder_types_gen.go @@ -642,6 +642,7 @@ func (v *recordBlock) MarshalJSON() ([]byte, error) { Evidence json.RawMessage `json:"evidence,omitempty"` Submissions encoding.JsonList[*messaging.Envelope] `json:"submissions,omitempty"` Changes encoding.JsonList[*recordChange] `json:"changes,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(!v.IsLeader) { u.IsLeader = v.IsLeader @@ -664,13 +665,15 @@ func (v *recordBlock) MarshalJSON() ([]byte, error) { if !(len(v.Changes) == 0) { u.Changes = v.Changes } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *recordChange) MarshalJSON() ([]byte, error) { u := struct { - Key *record.Key `json:"key,omitempty"` - Value *string `json:"value,omitempty"` + Key *record.Key `json:"key,omitempty"` + Value *string `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.Key == nil) { u.Key = v.Key @@ -678,16 +681,19 @@ func (v *recordChange) MarshalJSON() ([]byte, error) { if !(len(v.Value) == 0) { u.Value = encoding.BytesToJSON(v.Value) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *recordMessages) MarshalJSON() ([]byte, error) { u := struct { - Messages *encoding.JsonUnmarshalListWith[consensus.Message] `json:"messages,omitempty"` + Messages *encoding.JsonUnmarshalListWith[consensus.Message] `json:"messages,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Messages) == 0) { u.Messages = &encoding.JsonUnmarshalListWith[consensus.Message]{Value: v.Messages, Func: consensus.UnmarshalMessageJSON} } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -700,6 +706,7 @@ func (v *recordBlock) UnmarshalJSON(data []byte) error { Evidence json.RawMessage `json:"evidence,omitempty"` Submissions encoding.JsonList[*messaging.Envelope] `json:"submissions,omitempty"` Changes encoding.JsonList[*recordChange] `json:"changes,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.IsLeader = v.IsLeader u.Index = v.Index @@ -708,7 +715,8 @@ func (v *recordBlock) UnmarshalJSON(data []byte) error { u.Evidence = v.Evidence u.Submissions = v.Submissions u.Changes = v.Changes - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.IsLeader = u.IsLeader @@ -718,17 +726,23 @@ func (v *recordBlock) UnmarshalJSON(data []byte) error { v.Evidence = u.Evidence v.Submissions = u.Submissions v.Changes = u.Changes + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *recordChange) UnmarshalJSON(data []byte) error { u := struct { - Key *record.Key `json:"key,omitempty"` - Value *string `json:"value,omitempty"` + Key *record.Key `json:"key,omitempty"` + Value *string `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Key = v.Key u.Value = encoding.BytesToJSON(v.Value) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Key = u.Key @@ -737,15 +751,21 @@ func (v *recordChange) UnmarshalJSON(data []byte) error { } else { v.Value = x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *recordMessages) UnmarshalJSON(data []byte) error { u := struct { - Messages *encoding.JsonUnmarshalListWith[consensus.Message] `json:"messages,omitempty"` + Messages *encoding.JsonUnmarshalListWith[consensus.Message] `json:"messages,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Messages = &encoding.JsonUnmarshalListWith[consensus.Message]{Value: v.Messages, Func: consensus.UnmarshalMessageJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if u.Messages != nil { @@ -754,5 +774,9 @@ func (v *recordMessages) UnmarshalJSON(data []byte) error { v.Messages[i] = x } } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } diff --git a/tools/cmd/debug/types_gen.go b/tools/cmd/debug/types_gen.go index 30723156d..bcb9535a8 100644 --- a/tools/cmd/debug/types_gen.go +++ b/tools/cmd/debug/types_gen.go @@ -517,6 +517,7 @@ func (v *DbPatch) MarshalJSON() ([]byte, error) { u := struct { Operations *encoding.JsonUnmarshalListWith[DbPatchOp] `json:"operations,omitempty"` Result *DbPatchResult `json:"result,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(len(v.Operations) == 0) { u.Operations = &encoding.JsonUnmarshalListWith[DbPatchOp]{Value: v.Operations, Func: UnmarshalDbPatchOpJSON} @@ -524,36 +525,42 @@ func (v *DbPatch) MarshalJSON() ([]byte, error) { if !(v.Result == nil) { u.Result = v.Result } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *DbPatchResult) MarshalJSON() ([]byte, error) { u := struct { StateHash *string `json:"stateHash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} if !(v.StateHash == ([32]byte{})) { u.StateHash = encoding.ChainToJSON(&v.StateHash) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *DeleteDbPatchOp) MarshalJSON() ([]byte, error) { u := struct { - Type DbPatchOpType `json:"type"` - Key *record.Key `json:"key,omitempty"` + Type DbPatchOpType `json:"type"` + Key *record.Key `json:"key,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Key == nil) { u.Key = v.Key } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } func (v *PutDbPatchOp) MarshalJSON() ([]byte, error) { u := struct { - Type DbPatchOpType `json:"type"` - Key *record.Key `json:"key,omitempty"` - Value *string `json:"value,omitempty"` + Type DbPatchOpType `json:"type"` + Key *record.Key `json:"key,omitempty"` + Value *string `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() if !(v.Key == nil) { @@ -562,6 +569,7 @@ func (v *PutDbPatchOp) MarshalJSON() ([]byte, error) { if !(len(v.Value) == 0) { u.Value = encoding.BytesToJSON(v.Value) } + u.ExtraData = encoding.BytesToJSON(v.extraData) return json.Marshal(&u) } @@ -569,10 +577,12 @@ func (v *DbPatch) UnmarshalJSON(data []byte) error { u := struct { Operations *encoding.JsonUnmarshalListWith[DbPatchOp] `json:"operations,omitempty"` Result *DbPatchResult `json:"result,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Operations = &encoding.JsonUnmarshalListWith[DbPatchOp]{Value: v.Operations, Func: UnmarshalDbPatchOpJSON} u.Result = v.Result - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if u.Operations != nil { @@ -582,15 +592,21 @@ func (v *DbPatch) UnmarshalJSON(data []byte) error { } } v.Result = u.Result + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *DbPatchResult) UnmarshalJSON(data []byte) error { u := struct { StateHash *string `json:"stateHash,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.StateHash = encoding.ChainToJSON(&v.StateHash) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if x, err := encoding.ChainFromJSON(u.StateHash); err != nil { @@ -598,36 +614,48 @@ func (v *DbPatchResult) UnmarshalJSON(data []byte) error { } else { v.StateHash = *x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *DeleteDbPatchOp) UnmarshalJSON(data []byte) error { u := struct { - Type DbPatchOpType `json:"type"` - Key *record.Key `json:"key,omitempty"` + Type DbPatchOpType `json:"type"` + Key *record.Key `json:"key,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Key = v.Key - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { return fmt.Errorf("field Type: not equal: want %v, got %v", v.Type(), u.Type) } v.Key = u.Key + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } func (v *PutDbPatchOp) UnmarshalJSON(data []byte) error { u := struct { - Type DbPatchOpType `json:"type"` - Key *record.Key `json:"key,omitempty"` - Value *string `json:"value,omitempty"` + Type DbPatchOpType `json:"type"` + Key *record.Key `json:"key,omitempty"` + Value *string `json:"value,omitempty"` + ExtraData *string `json:"$epilogue,omitempty"` }{} u.Type = v.Type() u.Key = v.Key u.Value = encoding.BytesToJSON(v.Value) - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -639,5 +667,9 @@ func (v *PutDbPatchOp) UnmarshalJSON(data []byte) error { } else { v.Value = x } + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } return nil } diff --git a/tools/cmd/gen-types/types.go.tmpl b/tools/cmd/gen-types/types.go.tmpl index 8468852ca..f24374a49 100644 --- a/tools/cmd/gen-types/types.go.tmpl +++ b/tools/cmd/gen-types/types.go.tmpl @@ -293,11 +293,14 @@ func (v *{{$typ.FullName true false}}) UnmarshalFieldsFrom(reader *encoding.Read {{- template "jsonField" .}} {{- end}} {{- end}} + {{- if .IsBinary}} + ExtraData *string `json:"$epilogue,omitempty"` + {{- end}} } {{- end}} {{define "valueToJson"}} -{{- if .Field.IsMarshalled}} +{{- if .Field.IsMarshalled -}} {{valueToJson .Field (print .Dst "." .Field.Name) (print .Src "." (get .Field))}} {{- if .Field.AlternativeName}} {{valueToJson .Field (print .Dst "." .Field.AlternativeName) (print .Src "." (get .Field))}} @@ -345,7 +348,7 @@ func (v *{{.FullName true false}}) MarshalJSON() ([]byte, error) { {{template "valueToJson" map "Field" . "Src" (print "v." $name) "Dst" "u"}} } {{- else}} - {{- template "valueToJson" map "Field" . "Src" (print "v." $name) "Dst" "u"}} + {{ template "valueToJson" map "Field" . "Src" (print "v." $name) "Dst" "u"}} {{- end}} {{- end}} {{- end}} @@ -353,14 +356,18 @@ func (v *{{.FullName true false}}) MarshalJSON() ([]byte, error) { {{- if .IsMarshalled}} {{- if .OmitEmpty}} if !({{isZero . (print "v." (get .))}}) { - {{- template "valueToJson" map "Field" . "Src" "v" "Dst" "u"}} + {{ template "valueToJson" map "Field" . "Src" "v" "Dst" "u"}} } {{- else}} - {{- template "valueToJson" map "Field" . "Src" "v" "Dst" "u"}} + {{ template "valueToJson" map "Field" . "Src" "v" "Dst" "u"}} {{- end}} {{- end}} {{- end}} {{- end}} + + {{- if .IsBinary}} + u.ExtraData = encoding.BytesToJSON(v.extraData) + {{- end }} return json.Marshal(&u) } {{end}}{{end}} @@ -373,13 +380,14 @@ func (v *{{.FullName true false}}) UnmarshalJSON(data []byte) error { {{- if .IsEmbedded}} {{- $name := get .}} {{- range .TypeRef.Fields}} - {{- template "valueToJson" map "Field" . "Src" (print "v." $name) "Dst" "u"}} + {{ template "valueToJson" map "Field" . "Src" (print "v." $name) "Dst" "u"}} {{- end}} {{- else}} - {{- template "valueToJson" map "Field" . "Src" "v" "Dst" "u"}} + {{ template "valueToJson" map "Field" . "Src" "v" "Dst" "u"}} {{- end}} {{- end}} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } @@ -393,6 +401,13 @@ func (v *{{.FullName true false}}) UnmarshalJSON(data []byte) error { {{- template "valueFromJson" map "Field" . "Src" "u" "Dst" "v"}} {{- end}} {{- end}} + + {{- if .IsBinary}} + v.extraData, err = encoding.BytesFromJSON(u.ExtraData) + if err != nil { + return err + } + {{- end }} return nil } {{end}}{{end}} \ No newline at end of file diff --git a/tools/internal/typegen/types_gen.go b/tools/internal/typegen/types_gen.go index 0748daffd..effc4bdd3 100644 --- a/tools/internal/typegen/types_gen.go +++ b/tools/internal/typegen/types_gen.go @@ -107,43 +107,33 @@ func (v *ChainRecord) MarshalJSON() ([]byte, error) { }{} u.Type = v.Type() if !(len(v.RecordBase.Name) == 0) { - u.Name = v.RecordBase.Name } if !(len(v.RecordBase.Key) == 0) { - u.Key = v.RecordBase.Key } if !(len(v.RecordBase.Description) == 0) { - u.Description = v.RecordBase.Description } if !(v.RecordBase.Parent == nil) { - u.Parent = v.RecordBase.Parent } if !(!v.RecordBase.Private) { - u.Private = v.RecordBase.Private } if !(!v.RecordBase.OmitAccessor) { - u.OmitAccessor = v.RecordBase.OmitAccessor } if !(!v.RecordBase.OmitConstructor) { - u.OmitConstructor = v.RecordBase.OmitConstructor } if !(!v.RecordBase.CustomValueConstructor) { - u.CustomValueConstructor = v.RecordBase.CustomValueConstructor } if !(len(v.RecordBase.Parameters) == 0) { - u.Parameters = v.RecordBase.Parameters } if !(len(v.RecordBase.Index) == 0) { - u.Index = v.RecordBase.Index } if !(len(v.ChainType) == 0) { @@ -181,43 +171,33 @@ func (v *EntityRecord) MarshalJSON() ([]byte, error) { }{} u.Type = v.Type() if !(len(v.RecordBase.Name) == 0) { - u.Name = v.RecordBase.Name } if !(len(v.RecordBase.Key) == 0) { - u.Key = v.RecordBase.Key } if !(len(v.RecordBase.Description) == 0) { - u.Description = v.RecordBase.Description } if !(v.RecordBase.Parent == nil) { - u.Parent = v.RecordBase.Parent } if !(!v.RecordBase.Private) { - u.Private = v.RecordBase.Private } if !(!v.RecordBase.OmitAccessor) { - u.OmitAccessor = v.RecordBase.OmitAccessor } if !(!v.RecordBase.OmitConstructor) { - u.OmitConstructor = v.RecordBase.OmitConstructor } if !(!v.RecordBase.CustomValueConstructor) { - u.CustomValueConstructor = v.RecordBase.CustomValueConstructor } if !(len(v.RecordBase.Parameters) == 0) { - u.Parameters = v.RecordBase.Parameters } if !(len(v.RecordBase.Index) == 0) { - u.Index = v.RecordBase.Index } if !(len(v.Fields) == 0) { @@ -284,43 +264,33 @@ func (v *IndexRecord) MarshalJSON() ([]byte, error) { }{} u.Type = v.Type() if !(len(v.RecordBase.Name) == 0) { - u.Name = v.RecordBase.Name } if !(len(v.RecordBase.Key) == 0) { - u.Key = v.RecordBase.Key } if !(len(v.RecordBase.Description) == 0) { - u.Description = v.RecordBase.Description } if !(v.RecordBase.Parent == nil) { - u.Parent = v.RecordBase.Parent } if !(!v.RecordBase.Private) { - u.Private = v.RecordBase.Private } if !(!v.RecordBase.OmitAccessor) { - u.OmitAccessor = v.RecordBase.OmitAccessor } if !(!v.RecordBase.OmitConstructor) { - u.OmitConstructor = v.RecordBase.OmitConstructor } if !(!v.RecordBase.CustomValueConstructor) { - u.CustomValueConstructor = v.RecordBase.CustomValueConstructor } if !(len(v.RecordBase.Parameters) == 0) { - u.Parameters = v.RecordBase.Parameters } if !(len(v.RecordBase.Index) == 0) { - u.Index = v.RecordBase.Index } if !((v.DataType).Equal(new(FieldType))) { @@ -364,43 +334,33 @@ func (v *OtherRecord) MarshalJSON() ([]byte, error) { }{} u.Type = v.Type() if !(len(v.RecordBase.Name) == 0) { - u.Name = v.RecordBase.Name } if !(len(v.RecordBase.Key) == 0) { - u.Key = v.RecordBase.Key } if !(len(v.RecordBase.Description) == 0) { - u.Description = v.RecordBase.Description } if !(v.RecordBase.Parent == nil) { - u.Parent = v.RecordBase.Parent } if !(!v.RecordBase.Private) { - u.Private = v.RecordBase.Private } if !(!v.RecordBase.OmitAccessor) { - u.OmitAccessor = v.RecordBase.OmitAccessor } if !(!v.RecordBase.OmitConstructor) { - u.OmitConstructor = v.RecordBase.OmitConstructor } if !(!v.RecordBase.CustomValueConstructor) { - u.CustomValueConstructor = v.RecordBase.CustomValueConstructor } if !(len(v.RecordBase.Parameters) == 0) { - u.Parameters = v.RecordBase.Parameters } if !(len(v.RecordBase.Index) == 0) { - u.Index = v.RecordBase.Index } if !(len(v.DataType) == 0) { @@ -486,43 +446,33 @@ func (v *StateRecord) MarshalJSON() ([]byte, error) { }{} u.Type = v.Type() if !(len(v.RecordBase.Name) == 0) { - u.Name = v.RecordBase.Name } if !(len(v.RecordBase.Key) == 0) { - u.Key = v.RecordBase.Key } if !(len(v.RecordBase.Description) == 0) { - u.Description = v.RecordBase.Description } if !(v.RecordBase.Parent == nil) { - u.Parent = v.RecordBase.Parent } if !(!v.RecordBase.Private) { - u.Private = v.RecordBase.Private } if !(!v.RecordBase.OmitAccessor) { - u.OmitAccessor = v.RecordBase.OmitAccessor } if !(!v.RecordBase.OmitConstructor) { - u.OmitConstructor = v.RecordBase.OmitConstructor } if !(!v.RecordBase.CustomValueConstructor) { - u.CustomValueConstructor = v.RecordBase.CustomValueConstructor } if !(len(v.RecordBase.Parameters) == 0) { - u.Parameters = v.RecordBase.Parameters } if !(len(v.RecordBase.Index) == 0) { - u.Index = v.RecordBase.Index } if !((v.DataType).Equal(new(FieldType))) { @@ -573,7 +523,8 @@ func (v *ChainRecord) UnmarshalJSON(data []byte) error { u.Parameters = v.RecordBase.Parameters u.Index = v.RecordBase.Index u.ChainType = v.ChainType - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -644,7 +595,8 @@ func (v *EntityRecord) UnmarshalJSON(data []byte) error { u.Root = v.Root u.Interface = v.Interface u.Attributes = &encoding.JsonUnmarshalListWith[Record]{Value: v.Attributes, Func: UnmarshalRecordJSON} - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -718,7 +670,8 @@ func (v *IndexRecord) UnmarshalJSON(data []byte) error { u.Union = v.Union u.Collection = v.Collection u.Comparator = v.Comparator - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -776,7 +729,8 @@ func (v *OtherRecord) UnmarshalJSON(data []byte) error { u.Pointer = v.Pointer u.HasChains = v.HasChains u.Constructor = v.Constructor - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) { @@ -822,7 +776,8 @@ func (v *RecordBase) UnmarshalJSON(data []byte) error { u.CustomValueConstructor = v.CustomValueConstructor u.Parameters = v.Parameters u.Index = v.Index - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } v.Name = u.Name @@ -875,7 +830,8 @@ func (v *StateRecord) UnmarshalJSON(data []byte) error { u.Union = v.Union u.Collection = v.Collection u.Comparator = v.Comparator - if err := json.Unmarshal(data, &u); err != nil { + err := json.Unmarshal(data, &u) + if err != nil { return err } if !(v.Type() == u.Type) {