Documentation
¶
Overview ¶
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
Index ¶
- type IssueAction
- type IssuingValidator
- type RWSet
- type SetupAction
- type TransferAction
- type Translator
- func (w *Translator) AreTokensSpent(id []string, graphHiding bool) ([]bool, error)
- func (w *Translator) CommitTokenRequest(raw []byte, storeHash bool) error
- func (w *Translator) GetTransferMetadataSubKey(k string) (string, error)
- func (w *Translator) QueryTokens(ids []*token.ID) ([][]byte, error)
- func (w *Translator) ReadSetupParameters() ([]byte, error)
- func (w *Translator) ReadTokenRequest() ([]byte, error)
- func (w *Translator) Write(action interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IssueAction ¶
type IssuingValidator ¶
type IssuingValidator interface {
// Validate returns no error if the passed creator can issue tokens of the passed type,, an error otherwise.
Validate(creator view.Identity, tokenType string) error
}
IssuingValidator is used to establish if the creator can issue tokens of the passed type.
type SetupAction ¶
type TransferAction ¶
type TransferAction interface {
// Serialize returns the serialized version of the action
Serialize() ([]byte, error)
// NumOutputs returns the number of outputs of the action
NumOutputs() int
// GetSerializedOutputs returns the serialized outputs of the action
GetSerializedOutputs() ([][]byte, error)
// IsRedeemAt returns true if the output is a redeem output at the passed index
IsRedeemAt(index int) bool
// SerializeOutputAt returns the serialized output at the passed index
SerializeOutputAt(index int) ([]byte, error)
// GetInputs returns the identifiers of the inputs in the action.
GetInputs() ([]string, error)
// IsGraphHiding returns true if the action is graph hiding
IsGraphHiding() bool
// GetMetadata returns the action's metadata
GetMetadata() map[string][]byte
}
TransferAction is the action used to transfer tokens
type Translator ¶
Translator validates token requests and generates the corresponding RWSets
func (*Translator) AreTokensSpent ¶
func (w *Translator) AreTokensSpent(id []string, graphHiding bool) ([]bool, error)
func (*Translator) CommitTokenRequest ¶
func (w *Translator) CommitTokenRequest(raw []byte, storeHash bool) error
func (*Translator) GetTransferMetadataSubKey ¶
func (w *Translator) GetTransferMetadataSubKey(k string) (string, error)
func (*Translator) QueryTokens ¶
func (w *Translator) QueryTokens(ids []*token.ID) ([][]byte, error)
func (*Translator) ReadSetupParameters ¶
func (w *Translator) ReadSetupParameters() ([]byte, error)
func (*Translator) ReadTokenRequest ¶
func (w *Translator) ReadTokenRequest() ([]byte, error)
func (*Translator) Write ¶
func (w *Translator) Write(action interface{}) error
Write checks that transactions are correct wrt. the most recent rwset state. Write checks are ones that shall be done sequentially, since transactions within a block may introduce dependencies.
Click to show internal directories.
Click to hide internal directories.