Documentation ¶
Index ¶
- func IsRunningTests() bool
- type ActivateProtocolVersion
- type AddCredits
- type AuthDelegate
- type AuthVote
- type AuthorityValidator
- type BurnCredits
- 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) AuthorityIsAccepted(delegate AuthDelegate, batch *database.Batch, ...) (fallback bool, err error)
- func (x CreateDataAccount) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (CreateDataAccount) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, ...) (ready, fallback bool, err error)
- func (CreateDataAccount) Type() protocol.TransactionType
- func (x CreateDataAccount) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type CreateIdentity
- func (CreateIdentity) AllowMissingPrincipal(transaction *protocol.Transaction) bool
- func (CreateIdentity) AuthorityIsAccepted(delegate AuthDelegate, batch *database.Batch, ...) (fallback bool, err error)
- func (x CreateIdentity) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (CreateIdentity) SignerCanSign(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 (x CreateIdentity) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type CreateKeyBook
- func (CreateKeyBook) AuthorityIsAccepted(delegate AuthDelegate, batch *database.Batch, ...) (fallback bool, err error)
- func (x CreateKeyBook) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (CreateKeyBook) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, ...) (ready, fallback bool, err error)
- func (CreateKeyBook) Type() protocol.TransactionType
- func (x CreateKeyBook) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type CreateKeyPage
- type CreateLiteTokenAccount
- func (CreateLiteTokenAccount) AllowMissingPrincipal(transaction *protocol.Transaction) bool
- func (CreateLiteTokenAccount) AuthorityIsAccepted(AuthDelegate, *database.Batch, *protocol.Transaction, ...) (fallback bool, err error)
- func (CreateLiteTokenAccount) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (CreateLiteTokenAccount) SignerCanSign(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 (x CreateLiteTokenAccount) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type CreateToken
- func (CreateToken) AuthorityIsAccepted(delegate AuthDelegate, batch *database.Batch, ...) (fallback bool, err error)
- func (x CreateToken) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (CreateToken) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, ...) (ready, fallback bool, err error)
- func (CreateToken) Type() protocol.TransactionType
- func (x CreateToken) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type CreateTokenAccount
- func (CreateTokenAccount) AuthorityIsAccepted(delegate AuthDelegate, batch *database.Batch, ...) (fallback bool, err error)
- func (x CreateTokenAccount) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (CreateTokenAccount) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, ...) (ready, fallback bool, err error)
- func (CreateTokenAccount) Type() protocol.TransactionType
- func (x CreateTokenAccount) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type Delivery
- type DirectoryAnchor
- type IssueTokens
- type LockAccount
- type NetworkMaintenance
- func (x NetworkMaintenance) AuthorityIsAccepted(delegate AuthDelegate, batch *database.Batch, ...) (fallback bool, err error)
- func (x NetworkMaintenance) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (x NetworkMaintenance) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, ...) (ready, fallback bool, err error)
- func (NetworkMaintenance) Type() protocol.TransactionType
- func (x NetworkMaintenance) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- 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) ProcessNetworkMaintenanceOp(cause *url.TxID, op protocol.NetworkMaintenanceOperation)
- func (s *ProcessTransactionState) ProcessNetworkUpdate(cause [32]byte, account *url.URL, body protocol.TransactionBody)
- func (s *ProcessTransactionState) ProcessTransaction(txid *url.TxID)
- type ReceivedAnchor
- type SendTokens
- type SignatureValidationMetadata
- type SignerCanSignValidator
- 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 (m *StateManager) GetBatch() *database.Batch
- func (m *StateManager) GetHash() []byte
- 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 (x SyntheticCreateIdentity) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (SyntheticCreateIdentity) Type() protocol.TransactionType
- func (x 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 (x SyntheticDepositCredits) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (SyntheticDepositCredits) Type() protocol.TransactionType
- func (x 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 (x SyntheticDepositTokens) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (SyntheticDepositTokens) Type() protocol.TransactionType
- func (x SyntheticDepositTokens) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type SyntheticWriteData
- func (SyntheticWriteData) AllowMissingPrincipal(transaction *protocol.Transaction) bool
- func (x SyntheticWriteData) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (SyntheticWriteData) Type() protocol.TransactionType
- func (x SyntheticWriteData) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type SystemWriteData
- type TransactionExecutor
- type TransactionExecutorCleanup
- type TransferCredits
- type UpdateAccountAuth
- func (UpdateAccountAuth) AuthorityIsAccepted(delegate AuthDelegate, batch *database.Batch, ...) (fallback bool, err error)
- func (x UpdateAccountAuth) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (UpdateAccountAuth) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, ...) (ready, fallback bool, err error)
- func (UpdateAccountAuth) Type() protocol.TransactionType
- func (x UpdateAccountAuth) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type UpdateKey
- func (UpdateKey) AuthorityIsAccepted(delegate AuthDelegate, batch *database.Batch, ...) (fallback bool, err error)
- func (x UpdateKey) AuthorityWillVote(delegate AuthDelegate, batch *database.Batch, ...) (fallback bool, vote *AuthVote, err error)
- func (UpdateKey) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (x UpdateKey) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, ...) (ready, fallback bool, err error)
- func (UpdateKey) Type() protocol.TransactionType
- func (UpdateKey) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type UpdateKeyPage
- func (UpdateKeyPage) AuthorityIsAccepted(delegate AuthDelegate, batch *database.Batch, ...) (fallback bool, err error)
- func (x UpdateKeyPage) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (UpdateKeyPage) SignerCanSign(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 (x UpdateKeyPage) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type WriteData
- func (WriteData) AllowMissingPrincipal(transaction *protocol.Transaction) bool
- func (WriteData) AuthorityIsAccepted(_ AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, ...) (fallback bool, err error)
- func (x WriteData) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- func (WriteData) SignerCanSign(delegate AuthDelegate, batch *database.Batch, ...) (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 (x WriteData) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
- type WriteDataTo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRunningTests ¶ added in v1.4.0
func IsRunningTests() bool
Types ¶
type ActivateProtocolVersion ¶
type ActivateProtocolVersion struct{}
func (ActivateProtocolVersion) Execute ¶
func (x ActivateProtocolVersion) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (ActivateProtocolVersion) Type ¶
func (ActivateProtocolVersion) Type() protocol.TransactionType
func (ActivateProtocolVersion) Validate ¶
func (x ActivateProtocolVersion) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type AddCredits ¶
type AddCredits struct{}
func (AddCredits) Execute ¶
func (x AddCredits) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (AddCredits) Type ¶
func (AddCredits) Type() protocol.TransactionType
func (AddCredits) Validate ¶
func (x AddCredits) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type AuthDelegate ¶
type AuthDelegate interface { // GetMessageAs retrieves a signature by hash from the bundle or database. GetSignatureAs(batch *database.Batch, hash [32]byte) (protocol.Signature, error) // TransactionIsInitiated verifies the transaction has been paid for and the // initiator signature has been processed. TransactionIsInitiated(batch *database.Batch, transaction *protocol.Transaction) (bool, *messaging.CreditPayment, error) // AuthorityDidVote verifies the authority is ready to send an authority // signature. For most transactions, this succeeds if at least one of the // authority's signers is satisfied. AuthorityDidVote(batch *database.Batch, transaction *protocol.Transaction, authUrl *url.URL) (bool, protocol.VoteType, error) }
type AuthorityValidator ¶
type AuthorityValidator interface { // AuthorityWillVote checks if the authority is ready to vote. MUST NOT // MODIFY STATE. AuthorityWillVote(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, authority *url.URL) (fallback bool, vote *AuthVote, err error) }
type BurnCredits ¶
type BurnCredits struct{}
func (BurnCredits) Execute ¶
func (x BurnCredits) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (BurnCredits) Type ¶
func (BurnCredits) Type() protocol.TransactionType
func (BurnCredits) Validate ¶
func (x BurnCredits) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type BurnTokens ¶
type BurnTokens struct{}
func (BurnTokens) Execute ¶
func (x BurnTokens) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (BurnTokens) Type ¶
func (BurnTokens) Type() protocol.TransactionType
func (BurnTokens) Validate ¶
func (x BurnTokens) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type ChainUpdates ¶
type ChainUpdates struct { Entries []*protocol.BlockEntry SynthEntries []*database.BlockStateSynthTxnEntry }
func (*ChainUpdates) AddChainEntry ¶
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 ¶
func (*ChainUpdates) DidAddChainEntry ¶
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 ¶
func (c *ChainUpdates) DidUpdateChain(update *protocol.BlockEntry)
DidUpdateChain records a chain update.
func (*ChainUpdates) Merge ¶
func (c *ChainUpdates) Merge(d *ChainUpdates)
type CreateDataAccount ¶
type CreateDataAccount struct{}
func (CreateDataAccount) AuthorityIsAccepted ¶ added in v1.2.0
func (CreateDataAccount) AuthorityIsAccepted(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, sig *protocol.AuthoritySignature) (fallback bool, err error)
func (CreateDataAccount) Execute ¶
func (x CreateDataAccount) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (CreateDataAccount) TransactionIsReady ¶
func (CreateDataAccount) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction) (ready, fallback bool, err error)
func (CreateDataAccount) Type ¶
func (CreateDataAccount) Type() protocol.TransactionType
func (CreateDataAccount) Validate ¶
func (x CreateDataAccount) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type CreateIdentity ¶
type CreateIdentity struct{}
func (CreateIdentity) AllowMissingPrincipal ¶
func (CreateIdentity) AllowMissingPrincipal(transaction *protocol.Transaction) bool
func (CreateIdentity) AuthorityIsAccepted ¶ added in v1.2.0
func (CreateIdentity) AuthorityIsAccepted(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, sig *protocol.AuthoritySignature) (fallback bool, err error)
func (CreateIdentity) Execute ¶
func (x CreateIdentity) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (CreateIdentity) SignerCanSign ¶ added in v1.2.0
func (CreateIdentity) SignerCanSign(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, signer protocol.Signer) (fallback bool, err error)
func (CreateIdentity) TransactionIsReady ¶
func (CreateIdentity) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction) (ready, fallback bool, err error)
func (CreateIdentity) Type ¶
func (CreateIdentity) Type() protocol.TransactionType
func (CreateIdentity) Validate ¶
func (x CreateIdentity) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type CreateKeyBook ¶
type CreateKeyBook struct{}
func (CreateKeyBook) AuthorityIsAccepted ¶ added in v1.2.0
func (CreateKeyBook) AuthorityIsAccepted(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, sig *protocol.AuthoritySignature) (fallback bool, err error)
func (CreateKeyBook) Execute ¶
func (x CreateKeyBook) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (CreateKeyBook) TransactionIsReady ¶
func (CreateKeyBook) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction) (ready, fallback bool, err error)
func (CreateKeyBook) Type ¶
func (CreateKeyBook) Type() protocol.TransactionType
func (CreateKeyBook) Validate ¶
func (x CreateKeyBook) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type CreateKeyPage ¶
type CreateKeyPage struct{}
func (CreateKeyPage) Execute ¶
func (x CreateKeyPage) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (CreateKeyPage) Type ¶
func (CreateKeyPage) Type() protocol.TransactionType
func (CreateKeyPage) Validate ¶
func (x CreateKeyPage) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type CreateLiteTokenAccount ¶
type CreateLiteTokenAccount struct{}
func (CreateLiteTokenAccount) AllowMissingPrincipal ¶
func (CreateLiteTokenAccount) AllowMissingPrincipal(transaction *protocol.Transaction) bool
func (CreateLiteTokenAccount) AuthorityIsAccepted ¶ added in v1.2.0
func (CreateLiteTokenAccount) AuthorityIsAccepted(AuthDelegate, *database.Batch, *protocol.Transaction, *protocol.AuthoritySignature) (fallback bool, err error)
func (CreateLiteTokenAccount) Execute ¶
func (CreateLiteTokenAccount) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (CreateLiteTokenAccount) SignerCanSign ¶ added in v1.2.0
func (CreateLiteTokenAccount) SignerCanSign(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, signer protocol.Signer) (fallback bool, err error)
func (CreateLiteTokenAccount) TransactionIsReady ¶
func (CreateLiteTokenAccount) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction) (ready, fallback bool, err error)
func (CreateLiteTokenAccount) Type ¶
func (CreateLiteTokenAccount) Type() protocol.TransactionType
func (CreateLiteTokenAccount) Validate ¶
func (x CreateLiteTokenAccount) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type CreateToken ¶
type CreateToken struct{}
func (CreateToken) AuthorityIsAccepted ¶ added in v1.2.0
func (CreateToken) AuthorityIsAccepted(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, sig *protocol.AuthoritySignature) (fallback bool, err error)
func (CreateToken) Execute ¶
func (x CreateToken) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (CreateToken) TransactionIsReady ¶
func (CreateToken) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction) (ready, fallback bool, err error)
func (CreateToken) Type ¶
func (CreateToken) Type() protocol.TransactionType
func (CreateToken) Validate ¶
func (x CreateToken) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type CreateTokenAccount ¶
type CreateTokenAccount struct{}
func (CreateTokenAccount) AuthorityIsAccepted ¶ added in v1.2.0
func (CreateTokenAccount) AuthorityIsAccepted(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, sig *protocol.AuthoritySignature) (fallback bool, err error)
func (CreateTokenAccount) Execute ¶
func (x CreateTokenAccount) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (CreateTokenAccount) TransactionIsReady ¶
func (CreateTokenAccount) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction) (ready, fallback bool, err error)
func (CreateTokenAccount) Type ¶
func (CreateTokenAccount) Type() protocol.TransactionType
func (CreateTokenAccount) Validate ¶
func (x CreateTokenAccount) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type Delivery ¶
type Delivery struct { Internal bool Forwarded bool Signatures []protocol.Signature Transaction *protocol.Transaction State ProcessTransactionState }
func (*Delivery) IsForwarded ¶
IsForwarded returns true if the transaction was delivered within a SyntheticForwardedTransaction.
func (*Delivery) LoadTransaction ¶
LoadTransaction attempts to load the transaction from the database.
func (*Delivery) WasProducedInternally ¶
type DirectoryAnchor ¶
type DirectoryAnchor struct{}
func (DirectoryAnchor) Execute ¶
func (x DirectoryAnchor) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (DirectoryAnchor) Type ¶
func (DirectoryAnchor) Type() protocol.TransactionType
func (DirectoryAnchor) Validate ¶
func (x DirectoryAnchor) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type IssueTokens ¶
type IssueTokens struct{}
func (IssueTokens) Execute ¶
func (x IssueTokens) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (IssueTokens) Type ¶
func (IssueTokens) Type() protocol.TransactionType
func (IssueTokens) Validate ¶
func (x IssueTokens) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type LockAccount ¶
type LockAccount struct{}
func (LockAccount) Execute ¶
func (x LockAccount) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (LockAccount) Type ¶
func (LockAccount) Type() protocol.TransactionType
func (LockAccount) Validate ¶
func (x LockAccount) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type NetworkMaintenance ¶ added in v1.3.0
type NetworkMaintenance struct{}
func (NetworkMaintenance) AuthorityIsAccepted ¶ added in v1.3.0
func (x NetworkMaintenance) AuthorityIsAccepted(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, sig *protocol.AuthoritySignature) (fallback bool, err error)
func (NetworkMaintenance) Execute ¶ added in v1.3.0
func (x NetworkMaintenance) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (NetworkMaintenance) TransactionIsReady ¶ added in v1.3.0
func (x NetworkMaintenance) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction) (ready, fallback bool, err error)
func (NetworkMaintenance) Type ¶ added in v1.3.0
func (NetworkMaintenance) Type() protocol.TransactionType
func (NetworkMaintenance) Validate ¶ added in v1.3.0
func (x NetworkMaintenance) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type PartitionAnchor ¶
type PartitionAnchor struct{}
func (PartitionAnchor) Execute ¶
func (x PartitionAnchor) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (PartitionAnchor) Type ¶
func (PartitionAnchor) Type() protocol.TransactionType
func (PartitionAnchor) Validate ¶
func (x PartitionAnchor) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type PrincipalValidator ¶
type PrincipalValidator interface { TransactionExecutor AllowMissingPrincipal(*protocol.Transaction) bool }
PrincipalValidator validates the principal for a specific type of transaction.
type ProcessTransactionState ¶
type ProcessTransactionState struct { ProducedTxns []*protocol.Transaction AdditionalMessages []messaging.Message ChainUpdates ChainUpdates MakeMajorBlock uint64 MakeMajorBlockTime time.Time ReceivedAnchors []*ReceivedAnchor AcmeBurnt big.Int NetworkUpdate []*protocol.NetworkAccountUpdate }
func (*ProcessTransactionState) DidProduceTxn ¶
func (s *ProcessTransactionState) DidProduceTxn(url *url.URL, body protocol.TransactionBody)
DidProduceTxn records a produced transaction.
func (*ProcessTransactionState) DidReceiveAnchor ¶
func (s *ProcessTransactionState) DidReceiveAnchor(partition string, body protocol.AnchorBody, index int64)
func (*ProcessTransactionState) Merge ¶
func (s *ProcessTransactionState) Merge(r *ProcessTransactionState)
func (*ProcessTransactionState) ProcessNetworkMaintenanceOp ¶ added in v1.3.0
func (s *ProcessTransactionState) ProcessNetworkMaintenanceOp(cause *url.TxID, op protocol.NetworkMaintenanceOperation)
ProcessNetworkMaintenanceOp queues a internal.NetworkMaintenanceOp message for processing after the current bundle.
func (*ProcessTransactionState) ProcessNetworkUpdate ¶
func (s *ProcessTransactionState) ProcessNetworkUpdate(cause [32]byte, account *url.URL, body protocol.TransactionBody)
ProcessNetworkUpdate queues a internal.NetworkUpdate message for processing after the current bundle.
func (*ProcessTransactionState) ProcessTransaction ¶
func (s *ProcessTransactionState) ProcessTransaction(txid *url.TxID)
ProcessTransaction queues a transaction for processing after the current bundle.
type ReceivedAnchor ¶
type ReceivedAnchor struct { Partition string Body protocol.AnchorBody Index int64 }
type SendTokens ¶
type SendTokens struct{}
func (SendTokens) Execute ¶
func (x SendTokens) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (SendTokens) Type ¶
func (SendTokens) Type() protocol.TransactionType
func (SendTokens) Validate ¶
func (x SendTokens) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type SignatureValidationMetadata ¶
type SignatureValidationMetadata struct { Location *url.URL IsInitiator bool Delegated bool Forwarded bool }
func (SignatureValidationMetadata) Nested ¶
func (d SignatureValidationMetadata) Nested() bool
func (SignatureValidationMetadata) SetDelegated ¶
func (d SignatureValidationMetadata) SetDelegated() SignatureValidationMetadata
func (SignatureValidationMetadata) SetForwarded ¶
func (d SignatureValidationMetadata) SetForwarded() SignatureValidationMetadata
type SignerCanSignValidator ¶ added in v1.2.0
type SignerCanSignValidator interface {
SignerCanSign(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, signer protocol.Signer) (fallback bool, err error)
}
SignerCanSignValidator validates that a signer is authorized to sign a transaction (e.g a key page's black list).
type SignerValidator ¶
type SignerValidator interface { TransactionExecutor // AuthorityIsAccepted checks if the authority signature is accepted for the // transaction. AuthorityIsAccepted(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, sig *protocol.AuthoritySignature) (fallback bool, err error) // TransactionIsReady checks if the transaction is ready to be executed. TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction) (ready, fallback bool, err error) }
SignerValidator validates signatures for a specific type of transaction.
type StateManager ¶
type StateManager struct { AuthDelegate AuthDelegate Origin protocol.Account OriginUrl *url.URL // contains filtered or unexported fields }
func NewStateManager ¶
func NewStateManager(net execute.DescribeShim, globals *core.GlobalValues, authDelegate AuthDelegate, 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 NewStatelessManager ¶
func NewStatelessManager(net execute.DescribeShim, globals *core.GlobalValues, transaction *protocol.Transaction, logger log.Logger) *StateManager
NewStatelessManager creates a new state manager and does *not* hold a reference to any state such as the transaction's principal or the current network variables.
func (*StateManager) AddAuthority ¶
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 ¶
func (m *StateManager) Discard()
func (*StateManager) GetBatch ¶
func (m *StateManager) GetBatch() *database.Batch
func (*StateManager) GetHash ¶
func (m *StateManager) GetHash() []byte
func (*StateManager) InheritAuth ¶
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 ¶
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, scratch bool)
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 ¶
func (x SyntheticBurnTokens) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (SyntheticBurnTokens) Type ¶
func (SyntheticBurnTokens) Type() protocol.TransactionType
func (SyntheticBurnTokens) Validate ¶
func (x SyntheticBurnTokens) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type SyntheticCreateIdentity ¶
type SyntheticCreateIdentity struct{}
func (SyntheticCreateIdentity) AllowMissingPrincipal ¶
func (SyntheticCreateIdentity) AllowMissingPrincipal(transaction *protocol.Transaction) bool
func (SyntheticCreateIdentity) Execute ¶
func (x SyntheticCreateIdentity) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (SyntheticCreateIdentity) Type ¶
func (SyntheticCreateIdentity) Type() protocol.TransactionType
func (SyntheticCreateIdentity) Validate ¶
func (x SyntheticCreateIdentity) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type SyntheticDepositCredits ¶
type SyntheticDepositCredits struct{}
func (SyntheticDepositCredits) AllowMissingPrincipal ¶
func (SyntheticDepositCredits) AllowMissingPrincipal(transaction *protocol.Transaction) bool
func (SyntheticDepositCredits) DidFail ¶
func (SyntheticDepositCredits) DidFail(state *ProcessTransactionState, transaction *protocol.Transaction) error
func (SyntheticDepositCredits) Execute ¶
func (x SyntheticDepositCredits) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (SyntheticDepositCredits) Type ¶
func (SyntheticDepositCredits) Type() protocol.TransactionType
func (SyntheticDepositCredits) Validate ¶
func (x SyntheticDepositCredits) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type SyntheticDepositTokens ¶
type SyntheticDepositTokens struct{}
func (SyntheticDepositTokens) AllowMissingPrincipal ¶
func (SyntheticDepositTokens) AllowMissingPrincipal(transaction *protocol.Transaction) bool
func (SyntheticDepositTokens) DidFail ¶
func (SyntheticDepositTokens) DidFail(state *ProcessTransactionState, transaction *protocol.Transaction) error
func (SyntheticDepositTokens) Execute ¶
func (x SyntheticDepositTokens) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (SyntheticDepositTokens) Type ¶
func (SyntheticDepositTokens) Type() protocol.TransactionType
func (SyntheticDepositTokens) Validate ¶
func (x SyntheticDepositTokens) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type SyntheticWriteData ¶
type SyntheticWriteData struct{}
func (SyntheticWriteData) AllowMissingPrincipal ¶
func (SyntheticWriteData) AllowMissingPrincipal(transaction *protocol.Transaction) bool
func (SyntheticWriteData) Execute ¶
func (x SyntheticWriteData) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (SyntheticWriteData) Type ¶
func (SyntheticWriteData) Type() protocol.TransactionType
func (SyntheticWriteData) Validate ¶
func (x SyntheticWriteData) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type SystemWriteData ¶
type SystemWriteData struct{}
func (SystemWriteData) Execute ¶
func (x SystemWriteData) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (SystemWriteData) Type ¶
func (SystemWriteData) Type() protocol.TransactionType
func (SystemWriteData) Validate ¶
func (x SystemWriteData) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type TransactionExecutor ¶
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 ¶
type TransactionExecutorCleanup interface { // DidFail is called if the transaction failed. DidFail(*ProcessTransactionState, *protocol.Transaction) error }
TransactionExecutorCleanup cleans up after a failed transaction.
type TransferCredits ¶
type TransferCredits struct{}
func (TransferCredits) Execute ¶
func (x TransferCredits) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (TransferCredits) Type ¶
func (TransferCredits) Type() protocol.TransactionType
func (TransferCredits) Validate ¶
func (x TransferCredits) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type UpdateAccountAuth ¶
type UpdateAccountAuth struct{}
func (UpdateAccountAuth) AuthorityIsAccepted ¶ added in v1.2.0
func (UpdateAccountAuth) AuthorityIsAccepted(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, sig *protocol.AuthoritySignature) (fallback bool, err error)
func (UpdateAccountAuth) Execute ¶
func (x UpdateAccountAuth) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (UpdateAccountAuth) TransactionIsReady ¶
func (UpdateAccountAuth) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction) (ready, fallback bool, err error)
func (UpdateAccountAuth) Type ¶
func (UpdateAccountAuth) Type() protocol.TransactionType
func (UpdateAccountAuth) Validate ¶
func (x UpdateAccountAuth) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type UpdateKey ¶
type UpdateKey struct{}
func (UpdateKey) AuthorityIsAccepted ¶ added in v1.2.0
func (UpdateKey) AuthorityIsAccepted(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, sig *protocol.AuthoritySignature) (fallback bool, err error)
func (UpdateKey) AuthorityWillVote ¶ added in v1.2.0
func (UpdateKey) Execute ¶
func (UpdateKey) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (UpdateKey) TransactionIsReady ¶
func (x UpdateKey) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction) (ready, fallback bool, err error)
func (UpdateKey) Type ¶
func (UpdateKey) Type() protocol.TransactionType
func (UpdateKey) Validate ¶
func (UpdateKey) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type UpdateKeyPage ¶
type UpdateKeyPage struct{}
func (UpdateKeyPage) AuthorityIsAccepted ¶ added in v1.2.0
func (UpdateKeyPage) AuthorityIsAccepted(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, sig *protocol.AuthoritySignature) (fallback bool, err error)
func (UpdateKeyPage) Execute ¶
func (x UpdateKeyPage) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (UpdateKeyPage) SignerCanSign ¶ added in v1.2.0
func (UpdateKeyPage) SignerCanSign(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, signer protocol.Signer) (fallback bool, err error)
func (UpdateKeyPage) TransactionIsReady ¶
func (UpdateKeyPage) TransactionIsReady(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction) (ready, fallback bool, err error)
func (UpdateKeyPage) Type ¶
func (UpdateKeyPage) Type() protocol.TransactionType
func (UpdateKeyPage) Validate ¶
func (x UpdateKeyPage) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type WriteData ¶
type WriteData struct{}
func (WriteData) AllowMissingPrincipal ¶
func (WriteData) AllowMissingPrincipal(transaction *protocol.Transaction) bool
func (WriteData) AuthorityIsAccepted ¶ added in v1.2.0
func (WriteData) AuthorityIsAccepted(_ AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, _ *protocol.AuthoritySignature) (fallback bool, err error)
AuthorityIsAccepted returns nil if the transaction is writing to a lite data account.
func (WriteData) Execute ¶
func (x WriteData) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (WriteData) SignerCanSign ¶ added in v1.2.0
func (WriteData) SignerCanSign(delegate AuthDelegate, batch *database.Batch, transaction *protocol.Transaction, signer protocol.Signer) (fallback bool, err error)
SignerCanSign returns nil if the transaction is writing to a lite data account.
func (WriteData) TransactionIsReady ¶
func (WriteData) TransactionIsReady(_ AuthDelegate, batch *database.Batch, transaction *protocol.Transaction) (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 (x WriteData) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
type WriteDataTo ¶
type WriteDataTo struct{}
func (WriteDataTo) Execute ¶
func (x WriteDataTo) Execute(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
func (WriteDataTo) Type ¶
func (WriteDataTo) Type() protocol.TransactionType
func (WriteDataTo) Validate ¶
func (x WriteDataTo) Validate(st *StateManager, tx *Delivery) (protocol.TransactionResult, error)
Source Files ¶
- activate_protocol_version.go
- add_credits.go
- burn_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
- network_maintenance.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_write_data.go
- system_write_data.go
- transfer_credits.go
- txn_common.go
- update_account_auth.go
- update_key.go
- update_key_page.go
- utils.go
- write_data.go
- write_data_to.go