Documentation ¶
Index ¶
- type AcmeFaucet
- type AddCredits
- type AuthDelegate
- type BurnTokens
- type ChainUpdates
- func (u *ChainUpdates) AddChainEntry(batch *database.Batch, chain *database.Chain2, entry []byte, ...) error
- func (u *ChainUpdates) AddChainEntry2(batch *database.Batch, chain *database.Chain2, entry []byte, ...) (int64, error)
- func (c *ChainUpdates) DidAddChainEntry(batch *database.Batch, u *url.URL, name string, typ protocol.ChainType, ...) error
- func (c *ChainUpdates) DidUpdateChain(update *protocol.BlockEntry)
- func (c *ChainUpdates) Merge(d *ChainUpdates)
- type CreateDataAccount
- func (CreateDataAccount) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (CreateDataAccount) SignerIsAuthorized(delegate AuthDelegate, batch *database.Batch, ...) (fallback bool, err error)
- func (CreateDataAccount) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, ...) (ready, fallback bool, err error)
- func (CreateDataAccount) Type() protocol.TransactionType
- func (CreateDataAccount) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type CreateIdentity
- func (CreateIdentity) AllowMissingPrincipal(transaction *protocol.Transaction) bool
- func (CreateIdentity) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (CreateIdentity) SignerIsAuthorized(delegate AuthDelegate, batch *database.Batch, ...) (fallback bool, err error)
- func (CreateIdentity) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, ...) (ready, fallback bool, err error)
- func (CreateIdentity) Type() protocol.TransactionType
- func (CreateIdentity) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type CreateKeyBook
- func (CreateKeyBook) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (CreateKeyBook) SignerIsAuthorized(delegate AuthDelegate, batch *database.Batch, ...) (fallback bool, err error)
- func (CreateKeyBook) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, ...) (ready, fallback bool, err error)
- func (CreateKeyBook) Type() protocol.TransactionType
- func (CreateKeyBook) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type CreateKeyPage
- type CreateLiteTokenAccount
- func (CreateLiteTokenAccount) AllowMissingPrincipal(transaction *protocol.Transaction) bool
- func (CreateLiteTokenAccount) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (CreateLiteTokenAccount) SignerIsAuthorized(delegate AuthDelegate, batch *database.Batch, ...) (fallback bool, err error)
- func (CreateLiteTokenAccount) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, ...) (ready, fallback bool, err error)
- func (CreateLiteTokenAccount) Type() protocol.TransactionType
- func (CreateLiteTokenAccount) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type CreateToken
- func (CreateToken) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (CreateToken) SignerIsAuthorized(delegate AuthDelegate, batch *database.Batch, ...) (fallback bool, err error)
- func (CreateToken) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, ...) (ready, fallback bool, err error)
- func (CreateToken) Type() protocol.TransactionType
- func (CreateToken) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type CreateTokenAccount
- func (CreateTokenAccount) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (CreateTokenAccount) SignerIsAuthorized(delegate AuthDelegate, batch *database.Batch, ...) (fallback bool, err error)
- func (CreateTokenAccount) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, ...) (ready, fallback bool, err error)
- func (CreateTokenAccount) Type() protocol.TransactionType
- func (CreateTokenAccount) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type Delivery
- func (d *Delivery) IsForwarded() bool
- func (d *Delivery) LoadSyntheticMetadata(batch *database.Batch, typ protocol.TransactionType, ...) error
- func (d *Delivery) LoadTransaction(batch *database.Batch) (*protocol.TransactionStatus, error)
- func (d *Delivery) NewChild(transaction *protocol.Transaction, signatures []protocol.Signature) *Delivery
- func (d *Delivery) NewForwarded(fwd *protocol.SyntheticForwardTransaction) *Delivery
- func (d *Delivery) NewInternal(transaction *protocol.Transaction) *Delivery
- func (d *Delivery) NewSyntheticFromSequence(hash [32]byte) *Delivery
- func (d *Delivery) NewSyntheticReceipt(hash [32]byte, source *url.URL, receipt *managed.Receipt) *Delivery
- func (d *Delivery) Parent() *Delivery
- func (d *Delivery) WasProducedByPushedUpdate() bool
- func (d *Delivery) WasProducedInternally() bool
- type DirectoryAnchor
- type IssueTokens
- type LockAccount
- type PartitionAnchor
- type PrincipalValidator
- type ProcessTransactionState
- func (s *ProcessTransactionState) DidProduceTxn(url *url.URL, body protocol.TransactionBody)
- func (s *ProcessTransactionState) DidReceiveAnchor(partition string, body protocol.AnchorBody, index int64)
- func (s *ProcessTransactionState) Merge(r *ProcessTransactionState)
- func (s *ProcessTransactionState) ProcessAdditionalTransaction(txn *Delivery)
- type ReceivedAnchor
- type SendTokens
- type SignerValidator
- type StateManager
- func (m *StateManager) AddAuthority(account protocol.FullAccount, authority *url.URL) error
- func (c *StateManager) AddDirectoryEntry(directory *url.URL, u ...*url.URL) error
- func (m *StateManager) Commit() (*ProcessTransactionState, error)
- func (st *StateManager) Create(accounts ...protocol.Account) error
- func (m *StateManager) Discard()
- func (c *StateManager) GetHeight(u *url.URL) (uint64, error)
- func (m *StateManager) InheritAuth(account protocol.FullAccount) error
- func (c *StateManager) LoadTxn(txid [32]byte) (*protocol.Transaction, error)
- func (c *StateManager) LoadUrl(account *url.URL) (protocol.Account, error)
- func (c *StateManager) LoadUrlAs(account *url.URL, target interface{}) error
- func (m *StateManager) SetAuth(account protocol.FullAccount, authorities []*url.URL) error
- func (m *StateManager) Submit(url *url.URL, body protocol.TransactionBody)
- func (st *StateManager) Update(accounts ...protocol.Account) error
- func (m *StateManager) UpdateData(record protocol.Account, entryHash []byte, dataEntry protocol.DataEntry)
- type SyntheticBurnTokens
- type SyntheticCreateIdentity
- func (SyntheticCreateIdentity) AllowMissingPrincipal(transaction *protocol.Transaction) bool
- func (SyntheticCreateIdentity) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (SyntheticCreateIdentity) Type() protocol.TransactionType
- func (SyntheticCreateIdentity) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type SyntheticDepositCredits
- func (SyntheticDepositCredits) AllowMissingPrincipal(transaction *protocol.Transaction) bool
- func (SyntheticDepositCredits) DidFail(state *ProcessTransactionState, transaction *protocol.Transaction) error
- func (SyntheticDepositCredits) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (SyntheticDepositCredits) Type() protocol.TransactionType
- func (SyntheticDepositCredits) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type SyntheticDepositTokens
- func (SyntheticDepositTokens) AllowMissingPrincipal(transaction *protocol.Transaction) bool
- func (SyntheticDepositTokens) DidFail(state *ProcessTransactionState, transaction *protocol.Transaction) error
- func (SyntheticDepositTokens) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (SyntheticDepositTokens) Type() protocol.TransactionType
- func (SyntheticDepositTokens) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type SyntheticForwardTransaction
- func (SyntheticForwardTransaction) AllowMissingPrincipal(transaction *protocol.Transaction) bool
- func (SyntheticForwardTransaction) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (SyntheticForwardTransaction) Type() protocol.TransactionType
- func (SyntheticForwardTransaction) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type SyntheticWriteData
- func (SyntheticWriteData) AllowMissingPrincipal(transaction *protocol.Transaction) bool
- func (SyntheticWriteData) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (SyntheticWriteData) Type() protocol.TransactionType
- func (SyntheticWriteData) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type SystemWriteData
- type TransactionExecutor
- type TransactionExecutorCleanup
- type UpdateAccountAuth
- func (UpdateAccountAuth) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (UpdateAccountAuth) SignerIsAuthorized(delegate AuthDelegate, batch *database.Batch, ...) (fallback bool, err error)
- func (UpdateAccountAuth) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, ...) (ready, fallback bool, err error)
- func (UpdateAccountAuth) Type() protocol.TransactionType
- func (UpdateAccountAuth) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type UpdateKey
- type UpdateKeyPage
- func (UpdateKeyPage) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (UpdateKeyPage) SignerIsAuthorized(delegate AuthDelegate, batch *database.Batch, ...) (fallback bool, err error)
- func (UpdateKeyPage) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, ...) (ready, fallback bool, err error)
- func (UpdateKeyPage) Type() protocol.TransactionType
- func (UpdateKeyPage) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type WriteData
- func (WriteData) AllowMissingPrincipal(transaction *protocol.Transaction) bool
- func (WriteData) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (WriteData) SignerIsAuthorized(_ AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, ...) (fallback bool, err error)
- func (WriteData) TransactionIsReady(_ AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, ...) (ready, fallback bool, err error)
- func (WriteData) Type() protocol.TransactionType
- func (WriteData) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type WriteDataTo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcmeFaucet ¶
type AcmeFaucet struct{}
func (AcmeFaucet) Execute ¶ added in v0.6.0
func (AcmeFaucet) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (AcmeFaucet) Type ¶
func (AcmeFaucet) Type() protocol.TransactionType
func (AcmeFaucet) Validate ¶
func (AcmeFaucet) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type AddCredits ¶
type AddCredits struct{}
func (AddCredits) Execute ¶ added in v0.6.0
func (AddCredits) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (AddCredits) Type ¶
func (AddCredits) Type() protocol.TransactionType
func (AddCredits) Validate ¶
func (AddCredits) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type AuthDelegate ¶ added in v1.0.0
type AuthDelegate interface { GetAccountAuthoritySet(*database.Batch, protocol.Account) (*protocol.AccountAuth, error) SignerIsAuthorized(batch *database.Batch, transaction *protocol.Transaction, signer protocol.Signer, checkAuthz bool) error AuthorityIsSatisfied(batch *database.Batch, transaction *protocol.Transaction, status *protocol.TransactionStatus, authUrl *url.URL) (bool, error) SignerIsSatisfied(batch *database.Batch, transaction *protocol.Transaction, status *protocol.TransactionStatus, signer protocol.Signer) (bool, error) }
type BurnTokens ¶
type BurnTokens struct{}
func (BurnTokens) Execute ¶ added in v0.6.0
func (BurnTokens) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (BurnTokens) Type ¶
func (BurnTokens) Type() protocol.TransactionType
func (BurnTokens) Validate ¶
func (BurnTokens) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type ChainUpdates ¶ added in v0.5.1
type ChainUpdates struct { Entries []*protocol.BlockEntry SynthEntries []*database.BlockStateSynthTxnEntry }
func (*ChainUpdates) AddChainEntry ¶ added in v0.5.1
func (u *ChainUpdates) AddChainEntry(batch *database.Batch, chain *database.Chain2, entry []byte, sourceIndex, sourceBlock uint64) error
AddChainEntry adds an entry to a chain and records the chain update in the block state.
func (*ChainUpdates) AddChainEntry2 ¶ added in v1.0.0
func (*ChainUpdates) DidAddChainEntry ¶ added in v0.5.1
func (c *ChainUpdates) DidAddChainEntry(batch *database.Batch, u *url.URL, name string, typ protocol.ChainType, entry []byte, index, sourceIndex, sourceBlock uint64) error
DidAddChainEntry records a chain update in the block state.
func (*ChainUpdates) DidUpdateChain ¶ added in v0.5.1
func (c *ChainUpdates) DidUpdateChain(update *protocol.BlockEntry)
DidUpdateChain records a chain update.
func (*ChainUpdates) Merge ¶ added in v0.5.1
func (c *ChainUpdates) Merge(d *ChainUpdates)
type CreateDataAccount ¶
type CreateDataAccount struct{}
func (CreateDataAccount) Execute ¶ added in v0.6.0
func (CreateDataAccount) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (CreateDataAccount) SignerIsAuthorized ¶ added in v1.0.0
func (CreateDataAccount) SignerIsAuthorized(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, signer protocol.Signer, checkAuthz bool) (fallback bool, err error)
func (CreateDataAccount) TransactionIsReady ¶ added in v1.0.0
func (CreateDataAccount) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, status *protocol.TransactionStatus) (ready, fallback bool, err error)
func (CreateDataAccount) Type ¶
func (CreateDataAccount) Type() protocol.TransactionType
func (CreateDataAccount) Validate ¶
func (CreateDataAccount) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type CreateIdentity ¶
type CreateIdentity struct{}
func (CreateIdentity) AllowMissingPrincipal ¶ added in v0.6.0
func (CreateIdentity) AllowMissingPrincipal(transaction *protocol.Transaction) bool
func (CreateIdentity) Execute ¶ added in v0.6.0
func (CreateIdentity) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (CreateIdentity) SignerIsAuthorized ¶ added in v0.6.0
func (CreateIdentity) SignerIsAuthorized(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, signer protocol.Signer, checkAuthz bool) (fallback bool, err error)
func (CreateIdentity) TransactionIsReady ¶ added in v0.6.0
func (CreateIdentity) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, status *protocol.TransactionStatus) (ready, fallback bool, err error)
func (CreateIdentity) Type ¶
func (CreateIdentity) Type() protocol.TransactionType
func (CreateIdentity) Validate ¶
func (CreateIdentity) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type CreateKeyBook ¶
type CreateKeyBook struct{}
func (CreateKeyBook) Execute ¶ added in v0.6.0
func (CreateKeyBook) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (CreateKeyBook) SignerIsAuthorized ¶ added in v1.0.0
func (CreateKeyBook) SignerIsAuthorized(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, signer protocol.Signer, checkAuthz bool) (fallback bool, err error)
func (CreateKeyBook) TransactionIsReady ¶ added in v1.0.0
func (CreateKeyBook) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, status *protocol.TransactionStatus) (ready, fallback bool, err error)
func (CreateKeyBook) Type ¶
func (CreateKeyBook) Type() protocol.TransactionType
func (CreateKeyBook) Validate ¶
func (CreateKeyBook) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type CreateKeyPage ¶
type CreateKeyPage struct{}
func (CreateKeyPage) Execute ¶ added in v0.6.0
func (CreateKeyPage) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (CreateKeyPage) Type ¶
func (CreateKeyPage) Type() protocol.TransactionType
func (CreateKeyPage) Validate ¶
func (CreateKeyPage) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type CreateLiteTokenAccount ¶ added in v1.0.0
type CreateLiteTokenAccount struct{}
func (CreateLiteTokenAccount) AllowMissingPrincipal ¶ added in v1.0.0
func (CreateLiteTokenAccount) AllowMissingPrincipal(transaction *protocol.Transaction) bool
func (CreateLiteTokenAccount) Execute ¶ added in v1.0.0
func (CreateLiteTokenAccount) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (CreateLiteTokenAccount) SignerIsAuthorized ¶ added in v1.0.0
func (CreateLiteTokenAccount) SignerIsAuthorized(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, signer protocol.Signer, checkAuthz bool) (fallback bool, err error)
func (CreateLiteTokenAccount) TransactionIsReady ¶ added in v1.0.0
func (CreateLiteTokenAccount) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, status *protocol.TransactionStatus) (ready, fallback bool, err error)
func (CreateLiteTokenAccount) Type ¶ added in v1.0.0
func (CreateLiteTokenAccount) Type() protocol.TransactionType
func (CreateLiteTokenAccount) Validate ¶ added in v1.0.0
func (CreateLiteTokenAccount) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type CreateToken ¶
type CreateToken struct{}
func (CreateToken) Execute ¶ added in v0.6.0
func (CreateToken) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (CreateToken) SignerIsAuthorized ¶ added in v1.0.0
func (CreateToken) SignerIsAuthorized(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, signer protocol.Signer, checkAuthz bool) (fallback bool, err error)
func (CreateToken) TransactionIsReady ¶ added in v1.0.0
func (CreateToken) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, status *protocol.TransactionStatus) (ready, fallback bool, err error)
func (CreateToken) Type ¶
func (CreateToken) Type() protocol.TransactionType
func (CreateToken) Validate ¶
func (CreateToken) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type CreateTokenAccount ¶
type CreateTokenAccount struct{}
func (CreateTokenAccount) Execute ¶ added in v0.6.0
func (CreateTokenAccount) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (CreateTokenAccount) SignerIsAuthorized ¶ added in v1.0.0
func (CreateTokenAccount) SignerIsAuthorized(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, signer protocol.Signer, checkAuthz bool) (fallback bool, err error)
func (CreateTokenAccount) TransactionIsReady ¶ added in v1.0.0
func (CreateTokenAccount) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, status *protocol.TransactionStatus) (ready, fallback bool, err error)
func (CreateTokenAccount) Type ¶
func (CreateTokenAccount) Type() protocol.TransactionType
func (CreateTokenAccount) Validate ¶
func (CreateTokenAccount) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type Delivery ¶ added in v0.6.0
type Delivery struct { Signatures []protocol.Signature Transaction *protocol.Transaction State ProcessTransactionState // For synthetic transactions SequenceNumber uint64 SourceNetwork *url.URL // contains filtered or unexported fields }
func NormalizeEnvelope ¶ added in v0.6.0
NormalizeEnvelope normalizes the envelope into one or more deliveries.
func (*Delivery) IsForwarded ¶ added in v0.6.0
IsForwarded returns true if the transaction was delivered within a SyntheticForwardedTransaction.
func (*Delivery) LoadSyntheticMetadata ¶ added in v1.0.0
func (d *Delivery) LoadSyntheticMetadata(batch *database.Batch, typ protocol.TransactionType, status *protocol.TransactionStatus) error
func (*Delivery) LoadTransaction ¶ added in v0.6.0
LoadTransaction attempts to load the transaction from the database.
func (*Delivery) NewForwarded ¶ added in v0.6.0
func (d *Delivery) NewForwarded(fwd *protocol.SyntheticForwardTransaction) *Delivery
func (*Delivery) NewInternal ¶ added in v1.0.0
func (d *Delivery) NewInternal(transaction *protocol.Transaction) *Delivery
func (*Delivery) NewSyntheticFromSequence ¶ added in v1.0.0
func (*Delivery) NewSyntheticReceipt ¶ added in v0.6.0
func (*Delivery) WasProducedByPushedUpdate ¶ added in v1.0.0
WasProducedByPushedUpdate returns true if the transaction was produced by an update pushed via an anchor from the directory network.
func (*Delivery) WasProducedInternally ¶ added in v1.0.0
type DirectoryAnchor ¶ added in v1.0.0
type DirectoryAnchor struct{}
func (DirectoryAnchor) Execute ¶ added in v1.0.0
func (DirectoryAnchor) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (DirectoryAnchor) Type ¶ added in v1.0.0
func (DirectoryAnchor) Type() protocol.TransactionType
func (DirectoryAnchor) Validate ¶ added in v1.0.0
func (DirectoryAnchor) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type IssueTokens ¶
type IssueTokens struct{}
func (IssueTokens) Execute ¶ added in v0.6.0
func (IssueTokens) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (IssueTokens) Type ¶
func (IssueTokens) Type() protocol.TransactionType
func (IssueTokens) Validate ¶
func (IssueTokens) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type LockAccount ¶ added in v1.0.0
type LockAccount struct{}
func (LockAccount) Execute ¶ added in v1.0.0
func (LockAccount) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (LockAccount) Type ¶ added in v1.0.0
func (LockAccount) Type() protocol.TransactionType
func (LockAccount) Validate ¶ added in v1.0.0
func (LockAccount) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type PartitionAnchor ¶ added in v1.0.0
type PartitionAnchor struct{}
func (PartitionAnchor) Execute ¶ added in v1.0.0
func (PartitionAnchor) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (PartitionAnchor) Type ¶ added in v1.0.0
func (PartitionAnchor) Type() protocol.TransactionType
func (PartitionAnchor) Validate ¶ added in v1.0.0
func (PartitionAnchor) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type PrincipalValidator ¶ added in v1.0.0
type PrincipalValidator interface { TransactionExecutor AllowMissingPrincipal(*protocol.Transaction) bool }
PrincipalValidator validates the principal for a specific type of transaction.
type ProcessTransactionState ¶ added in v0.5.1
type ProcessTransactionState struct { ProducedTxns []*protocol.Transaction AdditionalTransactions []*Delivery ChainUpdates ChainUpdates MakeMajorBlock uint64 MakeMajorBlockTime time.Time ReceivedAnchors []*ReceivedAnchor }
func (*ProcessTransactionState) DidProduceTxn ¶ added in v0.5.1
func (s *ProcessTransactionState) DidProduceTxn(url *url.URL, body protocol.TransactionBody)
DidProduceTxn records a produced transaction.
func (*ProcessTransactionState) DidReceiveAnchor ¶ added in v1.0.0
func (s *ProcessTransactionState) DidReceiveAnchor(partition string, body protocol.AnchorBody, index int64)
func (*ProcessTransactionState) Merge ¶ added in v0.5.1
func (s *ProcessTransactionState) Merge(r *ProcessTransactionState)
func (*ProcessTransactionState) ProcessAdditionalTransaction ¶ added in v0.6.0
func (s *ProcessTransactionState) ProcessAdditionalTransaction(txn *Delivery)
type ReceivedAnchor ¶ added in v1.0.0
type ReceivedAnchor struct { Partition string Body protocol.AnchorBody Index int64 }
type SendTokens ¶
type SendTokens struct{}
func (SendTokens) Execute ¶ added in v0.6.0
func (SendTokens) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (SendTokens) Type ¶
func (SendTokens) Type() protocol.TransactionType
func (SendTokens) Validate ¶
func (SendTokens) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type SignerValidator ¶ added in v1.0.0
type SignerValidator interface { TransactionExecutor // SignerIsAuthorized checks if the signature is authorized for the // transaction. SignerIsAuthorized(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, signer protocol.Signer, checkAuthz bool) (fallback bool, err error) // TransactionIsReady checks if the transaction is ready to be executed. TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, status *protocol.TransactionStatus) (ready, fallback bool, err error) }
SignerValidator validates signatures for a specific type of transaction.
type StateManager ¶
type StateManager struct { Origin protocol.Account OriginUrl *url.URL // contains filtered or unexported fields }
func LoadStateManager ¶ added in v0.6.0
func LoadStateManager(net *config.Describe, globals *core.GlobalValues, batch *database.Batch, principal protocol.Account, transaction *protocol.Transaction, status *protocol.TransactionStatus, logger log.Logger) (*StateManager, error)
func NewStateManager ¶
func NewStateManager(net *config.Describe, globals *core.GlobalValues, batch *database.Batch, principal protocol.Account, transaction *protocol.Transaction, logger log.Logger) *StateManager
NewStateManager creates a new state manager and loads the transaction's origin. If the origin is not found, NewStateManager returns a valid state manager along with a not-found error.
func (*StateManager) AddAuthority ¶ added in v0.6.0
func (m *StateManager) AddAuthority(account protocol.FullAccount, authority *url.URL) error
func (*StateManager) AddDirectoryEntry ¶
func (*StateManager) Commit ¶
func (m *StateManager) Commit() (*ProcessTransactionState, error)
commit writes pending records to the database.
func (*StateManager) Discard ¶ added in v0.5.1
func (m *StateManager) Discard()
func (*StateManager) InheritAuth ¶ added in v0.6.0
func (m *StateManager) InheritAuth(account protocol.FullAccount) error
func (*StateManager) LoadTxn ¶
func (c *StateManager) LoadTxn(txid [32]byte) (*protocol.Transaction, error)
LoadTxn loads and unmarshals a saved transaction
func (*StateManager) LoadUrlAs ¶
LoadUrlAs loads a chain by URL and unmarshals it as a specific type.
func (*StateManager) SetAuth ¶ added in v0.6.0
func (m *StateManager) SetAuth(account protocol.FullAccount, authorities []*url.URL) error
func (*StateManager) Submit ¶
func (m *StateManager) Submit(url *url.URL, body protocol.TransactionBody)
Submit queues a synthetic transaction for submission.
func (*StateManager) Update ¶
Update queues a record for storage in the database. The queued update will fail if the record does not already exist, unless it is created by a synthetic transaction, or the record is a transaction.
func (*StateManager) UpdateData ¶
func (m *StateManager) UpdateData(record protocol.Account, entryHash []byte, dataEntry protocol.DataEntry)
UpdateData will cache a data associated with a DataAccount chain. the cache data will not be stored directly in the state but can be used upstream for storing a chain in the state database.
type SyntheticBurnTokens ¶
type SyntheticBurnTokens struct{}
func (SyntheticBurnTokens) Execute ¶ added in v0.6.0
func (SyntheticBurnTokens) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (SyntheticBurnTokens) Type ¶
func (SyntheticBurnTokens) Type() protocol.TransactionType
func (SyntheticBurnTokens) Validate ¶
func (SyntheticBurnTokens) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type SyntheticCreateIdentity ¶ added in v0.6.0
type SyntheticCreateIdentity struct{}
func (SyntheticCreateIdentity) AllowMissingPrincipal ¶ added in v1.0.0
func (SyntheticCreateIdentity) AllowMissingPrincipal(transaction *protocol.Transaction) bool
func (SyntheticCreateIdentity) Execute ¶ added in v0.6.0
func (SyntheticCreateIdentity) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (SyntheticCreateIdentity) Type ¶ added in v0.6.0
func (SyntheticCreateIdentity) Type() protocol.TransactionType
func (SyntheticCreateIdentity) Validate ¶ added in v0.6.0
func (SyntheticCreateIdentity) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type SyntheticDepositCredits ¶
type SyntheticDepositCredits struct{}
func (SyntheticDepositCredits) AllowMissingPrincipal ¶ added in v1.0.0
func (SyntheticDepositCredits) AllowMissingPrincipal(transaction *protocol.Transaction) bool
func (SyntheticDepositCredits) DidFail ¶ added in v1.0.0
func (SyntheticDepositCredits) DidFail(state *ProcessTransactionState, transaction *protocol.Transaction) error
func (SyntheticDepositCredits) Execute ¶ added in v0.6.0
func (SyntheticDepositCredits) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (SyntheticDepositCredits) Type ¶
func (SyntheticDepositCredits) Type() protocol.TransactionType
func (SyntheticDepositCredits) Validate ¶
func (SyntheticDepositCredits) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type SyntheticDepositTokens ¶
type SyntheticDepositTokens struct{}
func (SyntheticDepositTokens) AllowMissingPrincipal ¶ added in v1.0.0
func (SyntheticDepositTokens) AllowMissingPrincipal(transaction *protocol.Transaction) bool
func (SyntheticDepositTokens) DidFail ¶ added in v0.6.0
func (SyntheticDepositTokens) DidFail(state *ProcessTransactionState, transaction *protocol.Transaction) error
func (SyntheticDepositTokens) Execute ¶ added in v0.6.0
func (SyntheticDepositTokens) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (SyntheticDepositTokens) Type ¶
func (SyntheticDepositTokens) Type() protocol.TransactionType
func (SyntheticDepositTokens) Validate ¶
func (SyntheticDepositTokens) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type SyntheticForwardTransaction ¶ added in v0.6.0
type SyntheticForwardTransaction struct{}
func (SyntheticForwardTransaction) AllowMissingPrincipal ¶ added in v1.0.0
func (SyntheticForwardTransaction) AllowMissingPrincipal(transaction *protocol.Transaction) bool
func (SyntheticForwardTransaction) Execute ¶ added in v0.6.0
func (SyntheticForwardTransaction) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (SyntheticForwardTransaction) Type ¶ added in v0.6.0
func (SyntheticForwardTransaction) Type() protocol.TransactionType
func (SyntheticForwardTransaction) Validate ¶ added in v0.6.0
func (SyntheticForwardTransaction) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type SyntheticWriteData ¶
type SyntheticWriteData struct{}
func (SyntheticWriteData) AllowMissingPrincipal ¶ added in v1.0.0
func (SyntheticWriteData) AllowMissingPrincipal(transaction *protocol.Transaction) bool
func (SyntheticWriteData) Execute ¶ added in v0.6.0
func (SyntheticWriteData) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (SyntheticWriteData) Type ¶
func (SyntheticWriteData) Type() protocol.TransactionType
func (SyntheticWriteData) Validate ¶
func (SyntheticWriteData) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type SystemWriteData ¶ added in v1.0.0
type SystemWriteData struct{}
func (SystemWriteData) Execute ¶ added in v1.0.0
func (SystemWriteData) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (SystemWriteData) Type ¶ added in v1.0.0
func (SystemWriteData) Type() protocol.TransactionType
func (SystemWriteData) Validate ¶ added in v1.0.0
func (SystemWriteData) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type TransactionExecutor ¶ added in v1.0.0
type TransactionExecutor interface { // Type is the transaction type the executor can execute. Type() protocol.TransactionType // Validate validates the transaction for acceptance. Validate(*StateManager, *Delivery) (protocol.TransactionResult, error) // Execute fully validates and executes the transaction. Execute(*StateManager, *Delivery) (protocol.TransactionResult, error) }
TransactionExecutor executes a specific type of transaction.
type TransactionExecutorCleanup ¶ added in v1.0.0
type TransactionExecutorCleanup interface { // DidFail is called if the transaction failed. DidFail(*ProcessTransactionState, *protocol.Transaction) error }
TransactionExecutorCleanup cleans up after a failed transaction.
type UpdateAccountAuth ¶ added in v0.6.0
type UpdateAccountAuth struct{}
func (UpdateAccountAuth) Execute ¶ added in v0.6.0
func (UpdateAccountAuth) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (UpdateAccountAuth) SignerIsAuthorized ¶ added in v1.0.0
func (UpdateAccountAuth) SignerIsAuthorized(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, signer protocol.Signer, checkAuthz bool) (fallback bool, err error)
func (UpdateAccountAuth) TransactionIsReady ¶ added in v1.0.0
func (UpdateAccountAuth) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, status *protocol.TransactionStatus) (ready, fallback bool, err error)
func (UpdateAccountAuth) Type ¶ added in v0.6.0
func (UpdateAccountAuth) Type() protocol.TransactionType
func (UpdateAccountAuth) Validate ¶ added in v0.6.0
func (UpdateAccountAuth) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type UpdateKey ¶ added in v0.6.0
type UpdateKey struct{}
func (UpdateKey) Execute ¶ added in v0.6.0
func (UpdateKey) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (UpdateKey) Type ¶ added in v0.6.0
func (UpdateKey) Type() protocol.TransactionType
func (UpdateKey) Validate ¶ added in v0.6.0
func (UpdateKey) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type UpdateKeyPage ¶
type UpdateKeyPage struct{}
func (UpdateKeyPage) Execute ¶ added in v0.6.0
func (UpdateKeyPage) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (UpdateKeyPage) SignerIsAuthorized ¶ added in v1.0.0
func (UpdateKeyPage) SignerIsAuthorized(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, signer protocol.Signer, checkAuthz bool) (fallback bool, err error)
func (UpdateKeyPage) TransactionIsReady ¶ added in v1.0.0
func (UpdateKeyPage) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, status *protocol.TransactionStatus) (ready, fallback bool, err error)
func (UpdateKeyPage) Type ¶
func (UpdateKeyPage) Type() protocol.TransactionType
func (UpdateKeyPage) Validate ¶
func (UpdateKeyPage) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type WriteData ¶
type WriteData struct{}
func (WriteData) AllowMissingPrincipal ¶ added in v1.0.0
func (WriteData) AllowMissingPrincipal(transaction *protocol.Transaction) bool
func (WriteData) Execute ¶ added in v0.6.0
func (WriteData) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (WriteData) SignerIsAuthorized ¶ added in v0.6.0
func (WriteData) SignerIsAuthorized(_ AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, _ protocol.Signer, _ bool) (fallback bool, err error)
SignerIsAuthorized returns nil if the transaction is writing to a lite data account.
func (WriteData) TransactionIsReady ¶ added in v0.6.0
func (WriteData) TransactionIsReady(_ AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, status *protocol.TransactionStatus) (ready, fallback bool, err error)
TransactionIsReady returns true if the transaction is writing to a lite data account.
func (WriteData) Type ¶
func (WriteData) Type() protocol.TransactionType
func (WriteData) Validate ¶
func (WriteData) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type WriteDataTo ¶
type WriteDataTo struct{}
func (WriteDataTo) Execute ¶ added in v0.6.0
func (WriteDataTo) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (WriteDataTo) Type ¶
func (WriteDataTo) Type() protocol.TransactionType
func (WriteDataTo) Validate ¶
func (WriteDataTo) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
Source Files ¶
- acme_faucet.go
- add_credits.go
- burn_tokens.go
- create_data_account.go
- create_identity.go
- create_key_book.go
- create_key_page.go
- create_lite_token_account.go
- create_token.go
- create_token_account.go
- create_utils.go
- delivery.go
- directory_anchor.go
- issue_tokens.go
- lock_account.go
- partition_anchor.go
- pkg.go
- send_tokens.go
- state.go
- state_cache.go
- state_operation.go
- state_state.go
- synthetic_burn_tokens.go
- synthetic_create_identity.go
- synthetic_deposit_credits.go
- synthetic_deposit_tokens.go
- synthetic_forward_transaction.go
- synthetic_write_data.go
- system_write_data.go
- update_account_auth.go
- update_key.go
- update_key_page.go
- utils.go
- write_data.go
- write_data_to.go