Documentation ¶
Index ¶
- func CreateAccountBasedMigration(log zerolog.Logger, nWorker int, migrations []AccountBasedMigration) func(payloads []*ledger.Payload) ([]*ledger.Payload, error)
- func MigrateByAccount(log zerolog.Logger, nWorker int, allPayloads []*ledger.Payload, ...) ([]*ledger.Payload, error)
- func MigrateGroupConcurrently(log zerolog.Logger, migrations []AccountBasedMigration, ...) ([]*ledger.Payload, error)
- func NoOpMigration(p []ledger.Payload) ([]ledger.Payload, error)
- func PruneMigration(payload []ledger.Payload) ([]ledger.Payload, error)
- type AccountBasedMigration
- 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 ChangeContractCodeMigration
- func (d *ChangeContractCodeMigration) Close() error
- func (d *ChangeContractCodeMigration) InitMigration(log zerolog.Logger, _ []*ledger.Payload, _ int) error
- func (d *ChangeContractCodeMigration) MigrateAccount(_ context.Context, address common.Address, payloads []*ledger.Payload) ([]*ledger.Payload, error)
- func (d *ChangeContractCodeMigration) RegisterContractChange(address common.Address, contractName string, newContractCode string) (previousNewContractCode string)
- type DeduplicateContractNamesMigration
- func (d *DeduplicateContractNamesMigration) Close() error
- func (d *DeduplicateContractNamesMigration) InitMigration(log zerolog.Logger, _ []*ledger.Payload, _ int) error
- func (d *DeduplicateContractNamesMigration) MigrateAccount(ctx context.Context, address common.Address, payloads []*ledger.Payload) ([]*ledger.Payload, error)
- type SystemContractChange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAccountBasedMigration ¶ added in v0.33.1
func CreateAccountBasedMigration( log zerolog.Logger, nWorker int, migrations []AccountBasedMigration, ) func(payloads []*ledger.Payload) ([]*ledger.Payload, error)
CreateAccountBasedMigration creates a migration function that migrates the payloads account by account using the given migrations accounts are processed concurrently using the given number of workers but each account is processed sequentially by the given migrations in order. The migrations InitMigration function is called once before the migration starts And the Close function is called once after the migration finishes if the migration is a finisher.
func MigrateByAccount ¶ added in v0.29.0
func MigrateByAccount( log zerolog.Logger, nWorker int, allPayloads []*ledger.Payload, migrations []AccountBasedMigration, ) ( []*ledger.Payload, error, )
MigrateByAccount takes migrations and all the Payloads, and returns the migrated Payloads.
func MigrateGroupConcurrently ¶ added in v0.29.0
func MigrateGroupConcurrently( log zerolog.Logger, migrations []AccountBasedMigration, accountGroups *util.PayloadAccountGrouping, nWorker int, ) ([]*ledger.Payload, error)
MigrateGroupConcurrently migrate the Payloads in the given account groups. It uses nWorker to process the Payloads concurrently. The Payloads in each account are processed sequentially by the given migrations in order.
Types ¶
type AccountBasedMigration ¶ added in v0.33.1
type AccountBasedMigration interface { InitMigration( log zerolog.Logger, allPayloads []*ledger.Payload, nWorkers int, ) error MigrateAccount( ctx context.Context, address common.Address, payloads []*ledger.Payload, ) ([]*ledger.Payload, error) io.Closer }
AccountBasedMigration is an interface for migrations that migrate account by account concurrently getting all the payloads for each account at a time.
type AccountUsageMigrator ¶ added in v0.29.0
type AccountUsageMigrator struct {
// contains filtered or unexported fields
}
AccountUsageMigrator iterates through each payload, and calculate the storage usage and update the accounts status with the updated storage usage
func (*AccountUsageMigrator) Close ¶ added in v0.33.1
func (m *AccountUsageMigrator) Close() error
func (*AccountUsageMigrator) InitMigration ¶ added in v0.33.1
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 ChangeContractCodeMigration ¶ added in v0.33.1
type ChangeContractCodeMigration struct {
// contains filtered or unexported fields
}
func (*ChangeContractCodeMigration) Close ¶ added in v0.33.1
func (d *ChangeContractCodeMigration) Close() error
func (*ChangeContractCodeMigration) InitMigration ¶ added in v0.33.1
func (*ChangeContractCodeMigration) MigrateAccount ¶ added in v0.33.1
func (*ChangeContractCodeMigration) RegisterContractChange ¶ added in v0.33.1
type DeduplicateContractNamesMigration ¶ added in v0.33.1
type DeduplicateContractNamesMigration struct {
// contains filtered or unexported fields
}
DeduplicateContractNamesMigration checks if the contract names have been duplicated and removes the duplicate ones.
This migration de-syncs storage used, so it should be run before the StorageUsedMigration.
func (*DeduplicateContractNamesMigration) Close ¶ added in v0.33.1
func (d *DeduplicateContractNamesMigration) Close() error
func (*DeduplicateContractNamesMigration) InitMigration ¶ added in v0.33.1
type SystemContractChange ¶ added in v0.33.1
type SystemContractChange struct { Address common.Address ContractName string NewContractCode string }
func NewSystemContractChange ¶ added in v0.33.1
func NewSystemContractChange( systemContract systemcontracts.SystemContract, newContractCode []byte, ) SystemContractChange
func SystemContractChanges ¶ added in v0.33.1
func SystemContractChanges(chainID flow.ChainID) []SystemContractChange