blockchain

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package blockchain is a generated protocol buffer package.

It is generated from these files:

x/nft/blockchain/codec.proto

It has these top-level messages:

BlockchainToken
TokenDetails
Chain
IOV
Config
IssueTokenMsg

Index

Constants

View Source
const (
	BucketName = "bchnft"
)

Variables

View Source
var (
	ErrInvalidLengthCodec = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCodec   = fmt.Errorf("proto: integer overflow")
)
View Source
var (
	//todo: revisit pattern
	IsValidCodec = regexp.MustCompile(`^[a-zA-Z0-9_.]{3,20}$`).MatchString
)
View Source
var (
	//todo: revisit pattern
	IsValidID = regexp.MustCompile(`^[a-zA-Z0-9_.-]{4,128}$`).MatchString
)

Functions

func NewBlockchainToken

func NewBlockchainToken(key []byte, owner weave.Address, approvals []nft.ActionApprovals) *orm.SimpleObj

func RegisterQuery

func RegisterQuery(qr weave.QueryRouter)

RegisterQuery will register this bucket as "/nft/blockchain"

func RegisterRoutes

func RegisterRoutes(r weave.Registry, auth x.Authenticator, issuer weave.Address, tickerBucket orm.Reader)

RegisterRoutes will instantiate and register all handlers in this package

Types

type BlockchainToken

type BlockchainToken struct {
	Base    *nft.NonFungibleToken `protobuf:"bytes,1,opt,name=base" json:"base,omitempty"`
	Details *TokenDetails         `protobuf:"bytes,2,opt,name=details" json:"details,omitempty"`
}

func (*BlockchainToken) Approvals

func (m *BlockchainToken) Approvals() *nft.ApprovalOps

func (*BlockchainToken) Copy

func (m *BlockchainToken) Copy() orm.CloneableData

func (*BlockchainToken) Descriptor

func (*BlockchainToken) Descriptor() ([]byte, []int)

func (*BlockchainToken) GetBase

func (m *BlockchainToken) GetBase() *nft.NonFungibleToken

func (*BlockchainToken) GetChain

func (m *BlockchainToken) GetChain() Chain

func (*BlockchainToken) GetDetails

func (m *BlockchainToken) GetDetails() *TokenDetails

func (*BlockchainToken) GetIov

func (m *BlockchainToken) GetIov() IOV

func (*BlockchainToken) Marshal

func (m *BlockchainToken) Marshal() (dAtA []byte, err error)

func (*BlockchainToken) MarshalTo

func (m *BlockchainToken) MarshalTo(dAtA []byte) (int, error)

func (*BlockchainToken) OwnerAddress

func (m *BlockchainToken) OwnerAddress() weave.Address

func (*BlockchainToken) ProtoMessage

func (*BlockchainToken) ProtoMessage()

func (*BlockchainToken) Reset

func (m *BlockchainToken) Reset()

func (*BlockchainToken) SetApprovals added in v0.9.1

func (m *BlockchainToken) SetApprovals(a nft.Approvals)

func (*BlockchainToken) SetChain

func (m *BlockchainToken) SetChain(actor weave.Address, chain Chain) error

func (*BlockchainToken) SetIov

func (m *BlockchainToken) SetIov(actor weave.Address, iov IOV) error

func (*BlockchainToken) Size

func (m *BlockchainToken) Size() (n int)

func (*BlockchainToken) String

func (m *BlockchainToken) String() string

func (*BlockchainToken) Transfer

func (m *BlockchainToken) Transfer(newOwner weave.Address) error

func (*BlockchainToken) Unmarshal

func (m *BlockchainToken) Unmarshal(dAtA []byte) error

func (*BlockchainToken) Validate

func (m *BlockchainToken) Validate() error

type Bucket

type Bucket struct {
	orm.Bucket
}

func NewBucket

func NewBucket() Bucket

func (Bucket) Create

func (b Bucket) Create(db weave.KVStore, owner weave.Address, id []byte, approvals []nft.ActionApprovals, chain Chain, iov IOV) (orm.Object, error)

type Chain

type Chain struct {
	ChainID      string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
	NetworkID    string `protobuf:"bytes,2,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"`
	Name         string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	Enabled      bool   `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"`
	Production   bool   `protobuf:"varint,5,opt,name=production,proto3" json:"production,omitempty"`
	MainTickerID []byte `protobuf:"bytes,6,opt,name=main_ticker_id,json=mainTickerId,proto3" json:"main_ticker_id,omitempty"`
}

func (*Chain) Descriptor

func (*Chain) Descriptor() ([]byte, []int)

func (*Chain) GetChainID

func (m *Chain) GetChainID() string

func (*Chain) GetEnabled

func (m *Chain) GetEnabled() bool

func (*Chain) GetMainTickerID

func (m *Chain) GetMainTickerID() []byte

func (*Chain) GetName

func (m *Chain) GetName() string

func (*Chain) GetNetworkID

func (m *Chain) GetNetworkID() string

func (*Chain) GetProduction

func (m *Chain) GetProduction() bool

func (*Chain) Marshal

func (m *Chain) Marshal() (dAtA []byte, err error)

func (*Chain) MarshalTo

func (m *Chain) MarshalTo(dAtA []byte) (int, error)

func (*Chain) ProtoMessage

func (*Chain) ProtoMessage()

func (*Chain) Reset

func (m *Chain) Reset()

func (*Chain) Size

func (m *Chain) Size() (n int)

func (*Chain) String

func (m *Chain) String() string

func (*Chain) Unmarshal

func (m *Chain) Unmarshal(dAtA []byte) error

func (Chain) Validate

func (m Chain) Validate() error

type Config

type Config struct {
	Chain       *Chain `protobuf:"bytes,1,opt,name=chain" json:"chain,omitempty"`
	CodecConfig string `protobuf:"bytes,3,opt,name=codec_config,json=codecConfig,proto3" json:"codec_config,omitempty"`
}

func (*Config) Descriptor

func (*Config) Descriptor() ([]byte, []int)

func (*Config) GetChain

func (m *Config) GetChain() *Chain

func (*Config) GetCodecConfig

func (m *Config) GetCodecConfig() string

func (*Config) Marshal

func (m *Config) Marshal() (dAtA []byte, err error)

func (*Config) MarshalTo

func (m *Config) MarshalTo(dAtA []byte) (int, error)

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (m *Config) Reset()

func (*Config) Size

func (m *Config) Size() (n int)

func (*Config) String

func (m *Config) String() string

func (*Config) Unmarshal

func (m *Config) Unmarshal(dAtA []byte) error

type IOV

type IOV struct {
	Codec       string `protobuf:"bytes,1,opt,name=codec,proto3" json:"codec,omitempty"`
	CodecConfig string `protobuf:"bytes,2,opt,name=codec_config,json=codecConfig,proto3" json:"codec_config,omitempty"`
}

func (*IOV) Descriptor

func (*IOV) Descriptor() ([]byte, []int)

func (*IOV) GetCodec

func (m *IOV) GetCodec() string

func (*IOV) GetCodecConfig

func (m *IOV) GetCodecConfig() string

func (*IOV) Marshal

func (m *IOV) Marshal() (dAtA []byte, err error)

func (*IOV) MarshalTo

func (m *IOV) MarshalTo(dAtA []byte) (int, error)

func (*IOV) ProtoMessage

func (*IOV) ProtoMessage()

func (*IOV) Reset

func (m *IOV) Reset()

func (*IOV) Size

func (m *IOV) Size() (n int)

func (*IOV) String

func (m *IOV) String() string

func (*IOV) Unmarshal

func (m *IOV) Unmarshal(dAtA []byte) error

func (IOV) Validate

func (m IOV) Validate() error

type Initializer added in v0.10.0

type Initializer struct {
}

Initializer fulfils the InitStater interface to load data from the genesis file

func (*Initializer) FromGenesis added in v0.10.0

func (i *Initializer) FromGenesis(opts weave.Options, db weave.KVStore) error

FromGenesis will parse initial tokens information from the genesis and persist it in the database.

type IssueHandler

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

func NewIssueHandler

func NewIssueHandler(auth x.Authenticator, issuer weave.Address, bucket Bucket, tickerBucket orm.Reader) *IssueHandler

func (IssueHandler) Check

func (h IssueHandler) Check(ctx weave.Context, store weave.KVStore, tx weave.Tx) (weave.CheckResult, error)

func (IssueHandler) Deliver

func (h IssueHandler) Deliver(ctx weave.Context, store weave.KVStore, tx weave.Tx) (weave.DeliverResult, error)

type IssueTokenMsg

type IssueTokenMsg struct {
	Owner     []byte                `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
	ID        []byte                `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	Details   TokenDetails          `protobuf:"bytes,3,opt,name=details" json:"details"`
	Approvals []nft.ActionApprovals `protobuf:"bytes,4,rep,name=approvals" json:"approvals"`
}

func (*IssueTokenMsg) Descriptor

func (*IssueTokenMsg) Descriptor() ([]byte, []int)

func (*IssueTokenMsg) GetApprovals

func (m *IssueTokenMsg) GetApprovals() []nft.ActionApprovals

func (*IssueTokenMsg) GetDetails

func (m *IssueTokenMsg) GetDetails() TokenDetails

func (*IssueTokenMsg) GetID added in v0.10.0

func (m *IssueTokenMsg) GetID() []byte

func (*IssueTokenMsg) GetOwner

func (m *IssueTokenMsg) GetOwner() []byte

func (*IssueTokenMsg) Marshal

func (m *IssueTokenMsg) Marshal() (dAtA []byte, err error)

func (*IssueTokenMsg) MarshalTo

func (m *IssueTokenMsg) MarshalTo(dAtA []byte) (int, error)

func (*IssueTokenMsg) Path

func (*IssueTokenMsg) Path() string

Path returns the routing path for this message

func (*IssueTokenMsg) ProtoMessage

func (*IssueTokenMsg) ProtoMessage()

func (*IssueTokenMsg) Reset

func (m *IssueTokenMsg) Reset()

func (*IssueTokenMsg) Size

func (m *IssueTokenMsg) Size() (n int)

func (*IssueTokenMsg) String

func (m *IssueTokenMsg) String() string

func (*IssueTokenMsg) Unmarshal

func (m *IssueTokenMsg) Unmarshal(dAtA []byte) error

func (*IssueTokenMsg) Validate

func (i *IssueTokenMsg) Validate() error

type Token

type Token interface {
	nft.BaseNFT
	GetChain() Chain
	GetIov() IOV
	SetChain(actor weave.Address, chain Chain) error
	SetIov(actor weave.Address, iov IOV) error
}

func AsBlockchain

func AsBlockchain(obj orm.Object) (Token, error)

AsUsername will safely type-cast any value from Bucket

type TokenDetails

type TokenDetails struct {
	Chain Chain `protobuf:"bytes,1,opt,name=chain" json:"chain"`
	Iov   IOV   `protobuf:"bytes,2,opt,name=iov" json:"iov"`
}

func (*TokenDetails) Clone

func (m *TokenDetails) Clone() *TokenDetails

func (*TokenDetails) Descriptor

func (*TokenDetails) Descriptor() ([]byte, []int)

func (*TokenDetails) GetChain

func (m *TokenDetails) GetChain() Chain

func (*TokenDetails) GetIov

func (m *TokenDetails) GetIov() IOV

func (*TokenDetails) Marshal

func (m *TokenDetails) Marshal() (dAtA []byte, err error)

func (*TokenDetails) MarshalTo

func (m *TokenDetails) MarshalTo(dAtA []byte) (int, error)

func (*TokenDetails) ProtoMessage

func (*TokenDetails) ProtoMessage()

func (*TokenDetails) Reset

func (m *TokenDetails) Reset()

func (*TokenDetails) Size

func (m *TokenDetails) Size() (n int)

func (*TokenDetails) String

func (m *TokenDetails) String() string

func (*TokenDetails) Unmarshal

func (m *TokenDetails) Unmarshal(dAtA []byte) error

func (*TokenDetails) Validate

func (m *TokenDetails) Validate() error

Jump to

Keyboard shortcuts

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