Documentation ¶
Index ¶
- func MigrateAccountUsage(payloads []ledger.Payload, nWorker int) ([]ledger.Payload, error)
- func MigrateByAccount(migrator AccountMigrator, allPayloads []ledger.Payload, nWorker int) ([]ledger.Payload, error)
- func MigrateGroupConcurrently(migrator AccountMigrator, payloadsByAccount map[string][]ledger.Payload, ...) ([]ledger.Payload, error)
- func MigrateGroupSequentially(migrator AccountMigrator, payloadsByAccount map[string][]ledger.Payload) ([]ledger.Payload, error)
- func NoOpMigration(p []ledger.Payload) ([]ledger.Payload, error)
- func PayloadToAccount(p ledger.Payload) (string, bool, error)
- func PruneMigration(payload []ledger.Payload) ([]ledger.Payload, error)
- func StorageFeesMigration(payload []ledger.Payload) ([]ledger.Payload, error)
- type AccountMigrator
- type AccountUsageMigrator
- type AccountsAtreeLedger
- func (a *AccountsAtreeLedger) AllocateStorageIndex(owner []byte) (atree.StorageIndex, error)
- func (a *AccountsAtreeLedger) GetValue(owner, key []byte) ([]byte, error)
- func (a *AccountsAtreeLedger) SetValue(owner, key, value []byte) error
- func (a *AccountsAtreeLedger) ValueExists(owner, key []byte) (exists bool, err error)
- type PayloadGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MigrateAccountUsage ¶ added in v0.29.0
func MigrateByAccount ¶ added in v0.29.0
func MigrateByAccount(migrator AccountMigrator, allPayloads []ledger.Payload, nWorker int) ( []ledger.Payload, error)
MigrateByAccount teaks a migrator function and all the payloads, and return the migrated payloads
func MigrateGroupConcurrently ¶ added in v0.29.0
func MigrateGroupConcurrently( migrator AccountMigrator, payloadsByAccount map[string][]ledger.Payload, nWorker int, ) ( []ledger.Payload, error)
MigrateGroupConcurrently migrate the payloads in the given payloadsByAccount map which using the migrator It's similar to MigrateGroupSequentially, except it will migrate different groups concurrently
func MigrateGroupSequentially ¶ added in v0.29.0
func MigrateGroupSequentially( migrator AccountMigrator, payloadsByAccount map[string][]ledger.Payload, ) ( []ledger.Payload, error)
MigrateGroupSequentially migrate the payloads in the given payloadsByAccount map which using the migrator
func PayloadToAccount ¶ added in v0.29.0
PayloadToAccount takes a payload and return: - (address, true, nil) if the payload is for an account, the account address is returned - ("", false, nil) if the payload is not for an account - ("", false, err) if running into any exception
func PruneMigration ¶ added in v0.16.2
PruneMigration removes all the payloads with empty value this prunes the trie for values that has been deleted
Types ¶
type AccountMigrator ¶ added in v0.29.0
type AccountMigrator interface {
MigratePayloads(account string, payloads []ledger.Payload) ([]ledger.Payload, error)
}
AccountMigrator takes all the payloads that belong to the given account and return the migrated payloads
type AccountUsageMigrator ¶ added in v0.29.0
type AccountUsageMigrator struct{}
func (AccountUsageMigrator) MigratePayloads ¶ added in v0.29.0
func (m AccountUsageMigrator) MigratePayloads(account string, payloads []ledger.Payload) ([]ledger.Payload, error)
AccountUsageMigrator iterate through each payload, and calculate the storage usage and update the accoutns status with the updated storage usage
type AccountsAtreeLedger ¶ added in v0.23.2
type AccountsAtreeLedger struct {
Accounts environment.Accounts
}
func NewAccountsAtreeLedger ¶ added in v0.23.2
func NewAccountsAtreeLedger(accounts environment.Accounts) *AccountsAtreeLedger
func (*AccountsAtreeLedger) AllocateStorageIndex ¶ added in v0.23.2
func (a *AccountsAtreeLedger) AllocateStorageIndex(owner []byte) (atree.StorageIndex, error)
AllocateStorageIndex allocates new storage index under the owner accounts to store a new register
func (*AccountsAtreeLedger) GetValue ¶ added in v0.23.2
func (a *AccountsAtreeLedger) GetValue(owner, key []byte) ([]byte, error)
func (*AccountsAtreeLedger) SetValue ¶ added in v0.23.2
func (a *AccountsAtreeLedger) SetValue(owner, key, value []byte) error
func (*AccountsAtreeLedger) ValueExists ¶ added in v0.23.2
func (a *AccountsAtreeLedger) ValueExists(owner, key []byte) (exists bool, err error)
type PayloadGroup ¶ added in v0.29.0
type PayloadGroup struct { NonAccountPayloads []ledger.Payload Accounts map[string][]ledger.Payload }
PayloadGroup groups payloads by account. For global payloads, it's stored under NonAccountPayloads field
func PayloadGrouping ¶ added in v0.29.0
func PayloadGrouping(groups *PayloadGroup, payload ledger.Payload) (*PayloadGroup, error)
PayloadGrouping is a reducer function that adds the given payload to the corresponding group under its account