Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoKeysAvailable = fmt.Errorf("no signing keys available")
Functions ¶
This section is empty.
Types ¶
type AccountKey ¶
type AccountKey struct {
flowsdk.AccountKey
Address flowsdk.Address
Signer crypto.Signer
// contains filtered or unexported fields
}
func NewAccountKey ¶
func NewAccountKey( accountKey flowsdk.AccountKey, address flowsdk.Address, signer crypto.Signer, ) *AccountKey
func (*AccountKey) SetLockMetadata ¶
func (k *AccountKey) SetLockMetadata(txID flowsdk.Identifier, referenceBlockHeight uint64)
SetLockMetadata sets the transaction ID and reference block height for the transaction the key was used for.
func (*AccountKey) SetProposerPayerAndSign ¶
func (k *AccountKey) SetProposerPayerAndSign( tx *flowsdk.Transaction, address flowsdk.Address, acckey *flowsdk.AccountKey, ) error
SetProposerPayerAndSign sets the proposer, payer, and signs the transaction with the key.
type KeyLock ¶
type KeyLock interface {
// This method is intended for the happy path of valid EVM transactions.
// The event subscriber module only subscribes to EVM-related events:
// - `EVM.TransactionExecuted`
// - `EVM.BlockExecuted`
//
// Valid EVM transactions do emit `EVM.TransactionExecuted` events, so we
// release the account key that was used by the Flow tx which emitted
// the above EVM event.
NotifyTransaction(txID flowsdk.Identifier)
// This method is intended for the unhappy path of invalid EVM transactions.
// For each new Flow block, we check the result status of all included Flow
// transactions, and we release the account keys which they used. This also
// handles the release of expired transactions, that weren't even included
// in a Flow block.
NotifyBlock(blockHeader flowsdk.BlockHeader)
}
type KeyStore ¶
type KeyStore struct {
// contains filtered or unexported fields
}
func (*KeyStore) AvailableKeys ¶
AvailableKeys returns the number of keys available for use.
func (*KeyStore) HasKeysInUse ¶ added in v1.3.0
HasKeysInUse returns whether any of the keys are currently being used.
func (*KeyStore) NotifyBlock ¶
func (k *KeyStore) NotifyBlock(blockHeader flowsdk.BlockHeader)
NotifyBlock is called to notify the KeyStore of a newly ingested block. Pending transactions older than a threshold number of blocks are removed.
func (*KeyStore) NotifyTransaction ¶
func (k *KeyStore) NotifyTransaction(txID flowsdk.Identifier)
NotifyTransaction unlocks a key after use and puts it back into the pool.
func (*KeyStore) Take ¶
func (k *KeyStore) Take() (*AccountKey, error)
Take reserves a key for use in a transaction.
Click to show internal directories.
Click to hide internal directories.