Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNormalOperation ¶
func IsNormalOperation(t OperationType) bool
Types ¶
type Body ¶
type Body interface { // // Check that this transaction is self consistent // // This routine is used by the transaction checker and thus is part of consensus // // Params: // config = Consensus configuration // // Returns: // An `error` if that transaction is invalid, `nil` otherwise // IsWellFormed(common.Config) error HasFee() bool }
func UnmarshalBodyJSON ¶
func UnmarshalBodyJSON(t OperationType, b []byte) (Body, error)
type CollectTxFee ¶
type CollectTxFee struct { Target string `json:"target"` Amount common.Amount `json:"amount"` Txs uint64 `json:"txs"` Height uint64 `json:"block-height"` BlockHash string `json:"block-hash"` TotalTxs uint64 `json:"total-txs"` TotalOps uint64 `json:"total-ops"` }
OperationBodyTransactionFee is the operation to send the collected transacton fee to certain account. To prevent the hash duplication of transaction, OperationBodyTransactionFee has block related data.
func NewCollectTxFee ¶
func (CollectTxFee) GetAmount ¶
func (o CollectTxFee) GetAmount() common.Amount
func (CollectTxFee) HasFee ¶
func (o CollectTxFee) HasFee() bool
func (CollectTxFee) IsWellFormed ¶
func (o CollectTxFee) IsWellFormed(common.Config) (err error)
func (CollectTxFee) TargetAddress ¶
func (o CollectTxFee) TargetAddress() string
type CongressVoting ¶
type CongressVoting struct { Contract string `json:"contract"` Voting struct { Start uint64 `json:"start"` End uint64 `json:"end"` } `json:"voting"` FundingAddress string `json:"funding_address"` Amount common.Amount `json:"amount"` }
func NewCongressVoting ¶
func (CongressVoting) HasFee ¶
func (o CongressVoting) HasFee() bool
func (CongressVoting) IsWellFormed ¶
func (o CongressVoting) IsWellFormed(common.Config) (err error)
type CongressVotingResult ¶
type CongressVotingResult struct { BallotStamps struct { Hash string `json:"hash"` Urls []string `json:"urls"` } `json:"ballot_stamps"` Voters struct { Hash string `json:"hash"` Urls []string `json:"urls"` } `json:"voters"` Result struct { Count uint64 `json:"count"` Yes uint64 `json:"yes"` No uint64 `json:"no"` ABS uint64 `json:"abs"` } `json:"result"` CongressVotingHash string `json:"congress_voting_hash"` Membership struct { Hash string `json:"hash"` Urls []string `json:"urls"` } `json:"membership"` }
func NewCongressVotingResult ¶
func (CongressVotingResult) HasFee ¶
func (o CongressVotingResult) HasFee() bool
func (CongressVotingResult) IsWellFormed ¶
func (o CongressVotingResult) IsWellFormed(common.Config) (err error)
type CreateAccount ¶
type CreateAccount struct { Target string `json:"target"` Amount common.Amount `json:"amount"` Linked string `json:"linked,omitempty"` }
func NewCreateAccount ¶
func NewCreateAccount(target string, amount common.Amount, linked string) CreateAccount
func (CreateAccount) GetAmount ¶
func (o CreateAccount) GetAmount() common.Amount
func (CreateAccount) HasFee ¶
func (o CreateAccount) HasFee() bool
func (CreateAccount) IsWellFormed ¶
func (o CreateAccount) IsWellFormed(common.Config) (err error)
Implement transaction/operation : IsWellFormed
func (CreateAccount) TargetAddress ¶
func (o CreateAccount) TargetAddress() string
type Header ¶
type Header struct {
Type OperationType `json:"type"`
}
type Inflation ¶
type Inflation struct { Target string `json:"target"` Amount common.Amount `json:"amount"` InitialBalance common.Amount `json:"initial_balance"` Ratio string `json:"ratio"` Height uint64 `json:"block-height"` BlockHash string `json:"block-hash"` TotalTxs uint64 `json:"total-txs"` TotalOps uint64 `json:"total-ops"` }
Inflation is the operation to raise inflation in every block. To prevent the hash duplication of transaction, Inflation has block related data.
func (Inflation) TargetAddress ¶
type InflationPF ¶
type InflationPF struct { FundingAddress string `json:"funding_address"` Amount common.Amount `json:"amount"` VotingResult string `json:"voting-result"` }
func NewInflationPF ¶
func NewInflationPF( fundingAddress string, amount common.Amount, votingResult string, ) InflationPF
func (InflationPF) GetAmount ¶
func (o InflationPF) GetAmount() common.Amount
func (InflationPF) HasFee ¶
func (o InflationPF) HasFee() bool
func (InflationPF) IsWellFormed ¶
func (o InflationPF) IsWellFormed(common.Config) (err error)
type Operation ¶
func MakeTestPayment ¶
func MakeTestPaymentTo ¶
func NewOperation ¶
func (Operation) EncodeRLP ¶
Implement `common.Encoder` The implementation MUST use value type, not pointer
func (*Operation) UnmarshalJSON ¶
type OperationType ¶
type OperationType byte
const ( TypeCreateAccount OperationType = iota TypePayment TypeCongressVoting TypeCongressVotingResult TypeCollectTxFee TypeInflation TypeUnfreezingRequest TypeInflationPF )
func (OperationType) MarshalText ¶
func (ot OperationType) MarshalText() (text []byte, err error)
Implement encoding.TextMarshaler Also used in the API to avoid breaking clients
func (*OperationType) UnmarshalText ¶
func (ot *OperationType) UnmarshalText(text []byte) (err error)
Implement encoding.TextUnmarshaler
type Payment ¶
func (Payment) IsWellFormed ¶
Implement transaction/operation : IsWellFormed
func (Payment) TargetAddress ¶
type Targetable ¶
type Targetable interface {
TargetAddress() string
}
type UnfreezeRequest ¶
type UnfreezeRequest struct{}
func NewUnfreezeRequest ¶
func NewUnfreezeRequest() UnfreezeRequest
func (UnfreezeRequest) HasFee ¶
func (o UnfreezeRequest) HasFee() bool
func (UnfreezeRequest) IsWellFormed ¶
func (o UnfreezeRequest) IsWellFormed(common.Config) (err error)
Click to show internal directories.
Click to hide internal directories.