Skip to content

Commit

Permalink
Merge pull request #3694 from onflow/fxamacker/add-register-reads-tests
Browse files Browse the repository at this point in the history
[Account Storage Maps] Add more tests for register reads for GetDomainStorageMap()
  • Loading branch information
fxamacker authored Nov 25, 2024
2 parents caaf254 + ba76c11 commit 157d322
Show file tree
Hide file tree
Showing 2 changed files with 961 additions and 4 deletions.
16 changes: 12 additions & 4 deletions runtime/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,10 @@ type Storage struct {
var _ atree.SlabStorage = &Storage{}
var _ interpreter.Storage = &Storage{}

func NewStorage(
func NewPersistentSlabStorage(
ledger atree.Ledger,
memoryGauge common.MemoryGauge,
config StorageConfig,
) *Storage {
) *atree.PersistentSlabStorage {
decodeStorable := func(
decoder *cbor.StreamDecoder,
slabID atree.SlabID,
Expand All @@ -95,13 +94,22 @@ func NewStorage(
}

ledgerStorage := atree.NewLedgerBaseStorage(ledger)
persistentSlabStorage := atree.NewPersistentSlabStorage(

return atree.NewPersistentSlabStorage(
ledgerStorage,
interpreter.CBOREncMode,
interpreter.CBORDecMode,
decodeStorable,
decodeTypeInfo,
)
}

func NewStorage(
ledger atree.Ledger,
memoryGauge common.MemoryGauge,
config StorageConfig,
) *Storage {
persistentSlabStorage := NewPersistentSlabStorage(ledger, memoryGauge)

accountStorageV1 := NewAccountStorageV1(
ledger,
Expand Down
Loading

0 comments on commit 157d322

Please sign in to comment.