subscription

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Method_NewContract = "CONTRACT.SUBSCRIPTION.NEW"
	Method_Redeem      = "CONTRACT.SUBSCRIPTION.REDEEM"
	Method_Query       = "CONTRACT.SUBSCRIPTION.QUERY"
	Method_MemberQuery = "CONTRACT.SUBSCRIPTION.QUERYONE"
)

Variables

This section is empty.

Functions

func ExtendTemplateForDelegator

func ExtendTemplateForDelegator(cts tx.CollectiveTxs, cfg *StandardContractConfig) tx.CollectiveTxs

extend credential for delegator in each contract: a post handler and addr verifier is added for newcontract method a verifier is added for query method credential is required for memberquery method

func GeneralInvokingTemplate

func GeneralInvokingTemplate(ccname string, cfg ContractConfig) (ret tx.CollectiveTxs)

func GeneralQueryTemplate

func GeneralQueryTemplate(ccname string, cfg ContractConfig) (ret tx.CollectiveTxs)

func GetDeletagorAddress

func GetDeletagorAddress(cfg *StandardContractConfig) func(shim.ChaincodeStubInterface,
	proto.Message) []*txutil.Address

an address interface in verifier, checking for the contract's deligator

func MemberQueryHandler

func MemberQueryHandler(cfg ContractConfig) memberQueryHandler

func NewContractHandler

func NewContractHandler(cfg ContractConfig) newContractHandler

func NewContractVerifier

func NewContractVerifier(cfg *StandardContractConfig) contractCred

func NewRedeemContractAddrCred

func NewRedeemContractAddrCred(cfg ContractConfig) redeemContractAddrCred

func QueryHandler

func QueryHandler(cfg ContractConfig) queryHandler

func RedeemHandler

func RedeemHandler(cfg ContractConfig) redeemHandler

Types

type ContractConfig

type ContractConfig interface {
	NewTx(shim.ChaincodeStubInterface, []byte) ContractTx
}

type ContractTx

type ContractTx interface {
	New_C(addrs [][]byte, ratios []int) ([]byte, error) //return contract address
	Redeem_C(conaddr []byte, amount *big.Int, redeemAddrs [][]byte) (*pb.RedeemResponse, error)
	Query_C(addr []byte) (error, *pb.Contract_s)
	QueryOne_C(conaddr, addr []byte) (error, *pb.Contract_s)
}

type GeneralCall

type GeneralCall struct {
	*txgen.TxGenerator
}

func (*GeneralCall) New

func (i *GeneralCall) New(contract map[string]int32) ([]byte, error)

func (*GeneralCall) NewByDelegator

func (i *GeneralCall) NewByDelegator(contract map[string]int32, degAddrs string) ([]byte, error)

func (*GeneralCall) New_C

func (i *GeneralCall) New_C(addrs [][]byte, ratios []int) ([]byte, error)

func (*GeneralCall) Query

func (i *GeneralCall) Query(addr string) (error, *pb.Contract_s)

func (*GeneralCall) QueryOne

func (i *GeneralCall) QueryOne(conaddr, addr string) (error, *pb.Contract_s)

func (*GeneralCall) QueryOne_C

func (i *GeneralCall) QueryOne_C(conaddr []byte, addr []byte) (error, *pb.Contract_s)

func (*GeneralCall) Query_C

func (i *GeneralCall) Query_C(addr []byte) (error, *pb.Contract_s)

func (*GeneralCall) Redeem

func (i *GeneralCall) Redeem(conaddr string, amount *big.Int, redeemAddrs []string) (*pb.RedeemResponse, error)

func (*GeneralCall) Redeem_C

func (i *GeneralCall) Redeem_C(conaddr []byte, amount *big.Int, redeemAddrs [][]byte) (*pb.RedeemResponse, error)

type StandardContractConfig

type StandardContractConfig struct {
	Root string
	*runtime.Config
	TokenCfg token.TokenConfig
	AddrCfg  addrspace.AddrSpaceConfig
}

func NewConfig

func NewConfig(tag string) *StandardContractConfig

func (*StandardContractConfig) NewTx

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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