Documentation ¶
Index ¶
- type AccountStorage
- func (i *AccountStorage) MigrateStorageMap(inter *interpreter.Interpreter, domain string, migrate StorageMapKeyMigrator, ...)
- func (i *AccountStorage) MigrateStringKeys(inter *interpreter.Interpreter, key string, migrate StorageMapKeyMigrator)
- func (i *AccountStorage) MigrateUint64Keys(inter *interpreter.Interpreter, key string, migrate StorageMapKeyMigrator)
- type AddressIterator
- type AddressSliceIterator
- type DomainMigration
- type LegacyCharacterValue
- func (v *LegacyCharacterValue) HashInput(_ *interpreter.Interpreter, _ interpreter.LocationRange, scratch []byte) []byte
- func (v *LegacyCharacterValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)
- func (v *LegacyCharacterValue) Transfer(interpreter *interpreter.Interpreter, _ interpreter.LocationRange, ...) interpreter.Value
- type LegacyIntersectionType
- type LegacyPrimitiveStaticType
- type LegacyReferenceType
- type LegacyStringValue
- func (v *LegacyStringValue) HashInput(_ *interpreter.Interpreter, _ interpreter.LocationRange, scratch []byte) []byte
- func (v *LegacyStringValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)
- func (v *LegacyStringValue) Transfer(interpreter *interpreter.Interpreter, _ interpreter.LocationRange, ...) interpreter.Value
- type Reporter
- type StorageMapKeyMigrator
- type StorageMigration
- func (m *StorageMigration) Commit() error
- func (m *StorageMigration) Migrate(addressIterator AddressIterator, migrate StorageMapKeyMigrator)
- func (m *StorageMigration) MigrateAccount(address common.Address, migrate StorageMapKeyMigrator)
- func (m *StorageMigration) MigrateNestedValue(storageKey interpreter.StorageKey, storageMapKey interpreter.StorageMapKey, ...) (migratedValue interpreter.Value)
- func (m *StorageMigration) NewValueMigrationsPathMigrator(reporter Reporter, valueMigrations ...ValueMigration) StorageMapKeyMigrator
- type StorageMigrationError
- type ValueConverter
- type ValueMigration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountStorage ¶
type AccountStorage struct {
// contains filtered or unexported fields
}
func NewAccountStorage ¶
func NewAccountStorage(storage *runtime.Storage, address common.Address) AccountStorage
NewAccountStorage constructs an `AccountStorage` for a given account.
func (*AccountStorage) MigrateStorageMap ¶
func (i *AccountStorage) MigrateStorageMap( inter *interpreter.Interpreter, domain string, migrate StorageMapKeyMigrator, atreeKeyToStorageMapKey func(atree.Value) interpreter.StorageMapKey, )
func (*AccountStorage) MigrateStringKeys ¶
func (i *AccountStorage) MigrateStringKeys( inter *interpreter.Interpreter, key string, migrate StorageMapKeyMigrator, )
func (*AccountStorage) MigrateUint64Keys ¶
func (i *AccountStorage) MigrateUint64Keys( inter *interpreter.Interpreter, key string, migrate StorageMapKeyMigrator, )
type AddressIterator ¶
type AddressSliceIterator ¶
type AddressSliceIterator struct { Addresses []common.Address // contains filtered or unexported fields }
func (*AddressSliceIterator) NextAddress ¶
func (a *AddressSliceIterator) NextAddress() common.Address
func (*AddressSliceIterator) Reset ¶
func (a *AddressSliceIterator) Reset()
type DomainMigration ¶
type DomainMigration interface { Name() string Migrate( addressPath interpreter.AddressPath, ) }
type LegacyCharacterValue ¶
type LegacyCharacterValue struct {
interpreter.CharacterValue
}
LegacyCharacterValue simulates the old character-value which uses the un-normalized string for hashing.
func (*LegacyCharacterValue) HashInput ¶
func (v *LegacyCharacterValue) HashInput(_ *interpreter.Interpreter, _ interpreter.LocationRange, scratch []byte) []byte
func (*LegacyCharacterValue) StoredValue ¶
func (v *LegacyCharacterValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)
func (*LegacyCharacterValue) Transfer ¶
func (v *LegacyCharacterValue) Transfer( interpreter *interpreter.Interpreter, _ interpreter.LocationRange, _ atree.Address, remove bool, storable atree.Storable, _ map[atree.StorageID]struct{}, ) interpreter.Value
type LegacyIntersectionType ¶
type LegacyIntersectionType struct {
*interpreter.IntersectionStaticType
}
LegacyIntersectionType simulates the old, incorrect restricted-type type-ID generation, which did not sort the type IDs of the interface types.
func (*LegacyIntersectionType) ID ¶
func (t *LegacyIntersectionType) ID() common.TypeID
type LegacyPrimitiveStaticType ¶
type LegacyPrimitiveStaticType struct {
interpreter.PrimitiveStaticType
}
LegacyPrimitiveStaticType simulates the old primitive-static-type which uses the old type-ids for hashing.
func (LegacyPrimitiveStaticType) ID ¶
func (t LegacyPrimitiveStaticType) ID() common.TypeID
type LegacyReferenceType ¶
type LegacyReferenceType struct {
*interpreter.ReferenceStaticType
}
LegacyReferenceType simulates the old reference type with the old typeID generation.
func (*LegacyReferenceType) Encode ¶
func (t *LegacyReferenceType) Encode(e *cbor.StreamEncoder) error
func (*LegacyReferenceType) ID ¶
func (t *LegacyReferenceType) ID() common.TypeID
type LegacyStringValue ¶
type LegacyStringValue struct {
*interpreter.StringValue
}
LegacyStringValue simulates the old string-value which uses the un-normalized string for hashing.
func (*LegacyStringValue) HashInput ¶
func (v *LegacyStringValue) HashInput(_ *interpreter.Interpreter, _ interpreter.LocationRange, scratch []byte) []byte
func (*LegacyStringValue) StoredValue ¶
func (v *LegacyStringValue) StoredValue(_ atree.SlabStorage) (atree.Value, error)
func (*LegacyStringValue) Transfer ¶
func (v *LegacyStringValue) Transfer( interpreter *interpreter.Interpreter, _ interpreter.LocationRange, _ atree.Address, remove bool, storable atree.Storable, _ map[atree.StorageID]struct{}, ) interpreter.Value
type Reporter ¶
type Reporter interface { Migrated( storageKey interpreter.StorageKey, storageMapKey interpreter.StorageMapKey, migration string, ) Error(err error) }
type StorageMapKeyMigrator ¶
type StorageMapKeyMigrator func( inter *interpreter.Interpreter, storageKey interpreter.StorageKey, storageMap *interpreter.StorageMap, storageMapKey interpreter.StorageMapKey, )
func NewValueConverterPathMigrator ¶
func NewValueConverterPathMigrator(convertValue ValueConverter) StorageMapKeyMigrator
type StorageMigration ¶
type StorageMigration struct {
// contains filtered or unexported fields
}
func NewStorageMigration ¶
func NewStorageMigration( interpreter *interpreter.Interpreter, storage *runtime.Storage, ) *StorageMigration
func (*StorageMigration) Commit ¶
func (m *StorageMigration) Commit() error
func (*StorageMigration) Migrate ¶
func (m *StorageMigration) Migrate( addressIterator AddressIterator, migrate StorageMapKeyMigrator, )
func (*StorageMigration) MigrateAccount ¶
func (m *StorageMigration) MigrateAccount( address common.Address, migrate StorageMapKeyMigrator, )
func (*StorageMigration) MigrateNestedValue ¶
func (m *StorageMigration) MigrateNestedValue( storageKey interpreter.StorageKey, storageMapKey interpreter.StorageMapKey, value interpreter.Value, valueMigrations []ValueMigration, reporter Reporter, ) (migratedValue interpreter.Value)
func (*StorageMigration) NewValueMigrationsPathMigrator ¶
func (m *StorageMigration) NewValueMigrationsPathMigrator( reporter Reporter, valueMigrations ...ValueMigration, ) StorageMapKeyMigrator
type StorageMigrationError ¶
type StorageMigrationError struct { StorageKey interpreter.StorageKey StorageMapKey interpreter.StorageMapKey Migration string Err error Stack []byte }
func (StorageMigrationError) Error ¶
func (e StorageMigrationError) Error() string
type ValueConverter ¶
type ValueConverter func( storageKey interpreter.StorageKey, storageMapKey interpreter.StorageMapKey, value interpreter.Value, ) interpreter.Value
type ValueMigration ¶
type ValueMigration interface { Name() string Migrate( storageKey interpreter.StorageKey, storageMapKey interpreter.StorageMapKey, value interpreter.Value, interpreter *interpreter.Interpreter, ) (newValue interpreter.Value, err error) CanSkip(valueType interpreter.StaticType) bool }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.