chaincode

package
v0.0.0-...-7b36859 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deserialize

func Deserialize(bytes []byte, or *Order) error

Types

type Contract

type Contract struct {
	*contractapi.Contract
}

func (*Contract) Confirm

func (c *Contract) Confirm(ctx TransactionContextInterface, orderID int64, time string) (*Order, error)

func (*Contract) Dispatch

func (c *Contract) Dispatch(ctx TransactionContextInterface, orderID int64, time string) (*Order, error)

func (*Contract) GetHistory

func (c *Contract) GetHistory(ctx TransactionContextInterface, orderID int64) ([]byte, error)

func (*Contract) GetOrder

func (c *Contract) GetOrder(ctx TransactionContextInterface, orderID int64) (*Order, error)

func (*Contract) Instantiate

func (c *Contract) Instantiate()

func (*Contract) Launch

func (c *Contract) Launch(ctx TransactionContextInterface, orderID, price int64, time string) (*Order, error)

func (*Contract) Pay

func (c *Contract) Pay(ctx TransactionContextInterface, orderID int64, time string) (*Order, error)

type ListInterface

type ListInterface interface {
	ledgerapi.StateListInterface
}

type Order

type Order struct {
	OrderID      int64  `json:"orderID"`
	Price        int64  `json:"price"`
	LaunchTime   string `json:"launchTime"`
	PayTime      string `json:"payTime"`
	DispatchTime string `json:"dispatchTime"`
	ConfirmTime  string `json:"confirmTime"`
	// contains filtered or unexported fields
}

func (*Order) GetSplitKey

func (or *Order) GetSplitKey() []string

func (*Order) GetState

func (or *Order) GetState() State

func (Order) MarshalJSON

func (or Order) MarshalJSON() ([]byte, error)

func (*Order) Serialize

func (or *Order) Serialize() ([]byte, error)

func (*Order) SetState

func (or *Order) SetState(s State)

func (*Order) UnmarshalJSON

func (or *Order) UnmarshalJSON(data []byte) error

type OrderList

type OrderList struct {
	// contains filtered or unexported fields
}

func (*OrderList) AddState

func (ol *OrderList) AddState(state *Order) error

func (*OrderList) GetState

func (ol *OrderList) GetState(key string) (*Order, error)

func (*OrderList) UpdateState

func (ol *OrderList) UpdateState(state *Order) error

type State

type State uint
const (
	LAUNCHED State = iota + 1
	DISPATCHING
	CONFIRMED
)

func (State) String

func (state State) String() string

type TransactionContext

type TransactionContext struct {
	contractapi.TransactionContext
	// contains filtered or unexported fields
}

func (*TransactionContext) GetOrderList

func (tc *TransactionContext) GetOrderList() *OrderList

type TransactionContextInterface

type TransactionContextInterface interface {
	contractapi.TransactionContextInterface
	GetOrderList() *OrderList
}

Jump to

Keyboard shortcuts

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