encoding

package
v0.0.0-...-6d87009 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2022 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const (
	OperationPurposeUnknown       = 0
	OperationPurposeGroupEvent    = 1
	OperationPurposeAddProcess    = 11
	OperationPurposeCreditProcess = 12
)
View Source
const (
	EventExtraMaxSize = 256
)

Variables

This section is empty.

Functions

func JSONMarshalPanic

func JSONMarshalPanic(val interface{}) []byte

func JSONUnmarshal

func JSONUnmarshal(data []byte, val interface{}) error

Types

type Event

type Event struct {
	Process   string
	Asset     string
	Members   []string // need to do user mask per process
	Threshold int
	Amount    common.Integer
	Extra     []byte
	Timestamp uint64
	Nonce     uint64
	Signature []byte
}

MTG => VM process || nonce || asset || amount || extra || timestamp || members || threshold || sig

VM => MTG process || nonce || asset || amount || extra || timestamp || members || threshold

func DecodeEvent

func DecodeEvent(b []byte) (*Event, error)

func (*Event) Encode

func (e *Event) Encode() []byte

func (*Event) ID

func (e *Event) ID() string

type Operation

type Operation struct {
	Purpose  int
	Process  string
	Platform string
	Address  string
	Extra    []byte
}

func DecodeOperation

func DecodeOperation(b []byte) (*Operation, error)

func (*Operation) Encode

func (o *Operation) Encode() []byte

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL