Documentation ¶
Index ¶
- Variables
- func IsChainContract(addr types.Address) bool
- type ChainContract
- type ContractBlock
- type Mintage
- func (m *Mintage) DoReceive(ledger *l.Ledger, block *types.StateBlock, input *types.StateBlock) ([]*ContractBlock, error)
- func (m *Mintage) DoSend(l *l.Ledger, block *types.StateBlock) error
- func (m *Mintage) GetFee(ledger *l.Ledger, block *types.StateBlock) (types.Balance, error)
- func (m *Mintage) GetRefundData() []byte
- type VotePledge
- func (*VotePledge) DoReceive(ledger *ledger.Ledger, block *types.StateBlock, input *types.StateBlock) ([]*ContractBlock, error)
- func (*VotePledge) DoSend(l *ledger.Ledger, block *types.StateBlock) error
- func (p *VotePledge) GetFee(l *ledger.Ledger, block *types.StateBlock) (types.Balance, error)
- func (*VotePledge) GetRefundData() []byte
- type WithdrawMintage
- func (m *WithdrawMintage) DoReceive(ledger *l.Ledger, block *types.StateBlock, input *types.StateBlock) ([]*ContractBlock, error)
- func (m *WithdrawMintage) DoSend(ledger *l.Ledger, block *types.StateBlock) error
- func (m *WithdrawMintage) GetFee(ledger *l.Ledger, block *types.StateBlock) (types.Balance, error)
- func (m *WithdrawMintage) GetRefundData() []byte
- type WithdrawVotePledge
- func (*WithdrawVotePledge) DoReceive(ledger *ledger.Ledger, block *types.StateBlock, input *types.StateBlock) ([]*ContractBlock, error)
- func (*WithdrawVotePledge) DoSend(ledger *ledger.Ledger, block *types.StateBlock) (err error)
- func (*WithdrawVotePledge) GetFee(ledger *ledger.Ledger, block *types.StateBlock) (types.Balance, error)
- func (*WithdrawVotePledge) GetRefundData() []byte
Constants ¶
This section is empty.
Variables ¶
View Source
var (
MinPledgeAmount = big.NewInt(1e12) // 10K QLC
)
Functions ¶
func IsChainContract ¶
Types ¶
type ChainContract ¶
type ChainContract interface { GetFee(ledger *ledger.Ledger, block *types.StateBlock) (types.Balance, error) // DoSend verify or update StateBlock.Data DoSend(ledger *ledger.Ledger, block *types.StateBlock) error // check status, update state DoReceive(ledger *ledger.Ledger, block *types.StateBlock, input *types.StateBlock) ([]*ContractBlock, error) // refund data at receive error GetRefundData() []byte }
func GetChainContract ¶
type ContractBlock ¶
type ContractBlock struct { Block *types.StateBlock ToAddress types.Address BlockType types.BlockType Amount types.Balance Token types.Hash Data []byte }
ContractBlock generated by contract
type Mintage ¶
type Mintage struct{}
func (*Mintage) DoReceive ¶
func (m *Mintage) DoReceive(ledger *l.Ledger, block *types.StateBlock, input *types.StateBlock) ([]*ContractBlock, error)
TODO: verify input block timestamp
func (*Mintage) GetRefundData ¶
type VotePledge ¶ added in v1.0.3
type VotePledge struct { }
func (*VotePledge) DoReceive ¶ added in v1.0.3
func (*VotePledge) DoReceive(ledger *ledger.Ledger, block *types.StateBlock, input *types.StateBlock) ([]*ContractBlock, error)
func (*VotePledge) DoSend ¶ added in v1.0.3
func (*VotePledge) DoSend(l *ledger.Ledger, block *types.StateBlock) error
check pledge chain coin - address is normal user address - small than min pledge amount transfer quota to beneficial address
func (*VotePledge) GetFee ¶ added in v1.0.3
func (p *VotePledge) GetFee(l *ledger.Ledger, block *types.StateBlock) (types.Balance, error)
func (*VotePledge) GetRefundData ¶ added in v1.0.3
func (*VotePledge) GetRefundData() []byte
type WithdrawMintage ¶
type WithdrawMintage struct{}
func (*WithdrawMintage) DoReceive ¶
func (m *WithdrawMintage) DoReceive(ledger *l.Ledger, block *types.StateBlock, input *types.StateBlock) ([]*ContractBlock, error)
func (*WithdrawMintage) DoSend ¶
func (m *WithdrawMintage) DoSend(ledger *l.Ledger, block *types.StateBlock) error
func (*WithdrawMintage) GetFee ¶
func (m *WithdrawMintage) GetFee(ledger *l.Ledger, block *types.StateBlock) (types.Balance, error)
func (*WithdrawMintage) GetRefundData ¶
func (m *WithdrawMintage) GetRefundData() []byte
type WithdrawVotePledge ¶ added in v1.0.3
type WithdrawVotePledge struct { }
func (*WithdrawVotePledge) DoReceive ¶ added in v1.0.3
func (*WithdrawVotePledge) DoReceive(ledger *ledger.Ledger, block *types.StateBlock, input *types.StateBlock) ([]*ContractBlock, error)
func (*WithdrawVotePledge) DoSend ¶ added in v1.0.3
func (*WithdrawVotePledge) DoSend(ledger *ledger.Ledger, block *types.StateBlock) (err error)
func (*WithdrawVotePledge) GetFee ¶ added in v1.0.3
func (*WithdrawVotePledge) GetFee(ledger *ledger.Ledger, block *types.StateBlock) (types.Balance, error)
func (*WithdrawVotePledge) GetRefundData ¶ added in v1.0.3
func (*WithdrawVotePledge) GetRefundData() []byte
Click to show internal directories.
Click to hide internal directories.