Skip to content

Commit fbd2d47

Browse files
authored
Merge pull request #4449 from onflow/fxamacker/remove-loadedvalueiterator-wrapper
Replace mapLoadedValueIterator wrapper by using Atree implementation
2 parents b5b2fb9 + ea314e4 commit fbd2d47

5 files changed

Lines changed: 8 additions & 30 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/kr/pretty v0.3.1
1919
github.com/leanovate/gopter v0.2.11
2020
github.com/logrusorgru/aurora/v4 v4.0.0
21-
github.com/onflow/atree v0.13.1-0.20260305200207-dad78366916d
21+
github.com/onflow/atree v0.14.0
2222
github.com/onflow/crypto v0.25.3
2323
github.com/onflow/fixed-point v0.1.1
2424
github.com/rivo/uniseg v0.4.7

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJE
251251
github.com/neelance/sourcemap v0.0.0-20200213170602-2833bce08e4c/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
252252
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
253253
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
254-
github.com/onflow/atree v0.13.1-0.20260305200207-dad78366916d h1:lcP5qPEKL6xDVyQ5xAjr6EvO/q9cT5hT7gpjmV1pgfs=
255-
github.com/onflow/atree v0.13.1-0.20260305200207-dad78366916d/go.mod h1:qdZcfLQwPirHcNpLiK+2t3KAo+SAb9Si6TqurE6pykE=
254+
github.com/onflow/atree v0.14.0 h1:VFrvRsDBfBujviAseIYFb/KCo2mD4chcM7LpGbcCDdM=
255+
github.com/onflow/atree v0.14.0/go.mod h1:qdZcfLQwPirHcNpLiK+2t3KAo+SAb9Si6TqurE6pykE=
256256
github.com/onflow/crypto v0.25.3 h1:XQ3HtLsw8h1+pBN+NQ1JYM9mS2mVXTyg55OldaAIF7U=
257257
github.com/onflow/crypto v0.25.3/go.mod h1:+1igaXiK6Tjm9wQOBD1EGwW7bYWMUGKtwKJ/2QL/OWs=
258258
github.com/onflow/fixed-point v0.1.1 h1:j0jYZVO8VGyk1476alGudEg7XqCkeTVxb5ElRJRKS90=

interpreter/domain_storagemap.go

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,8 @@ func (s *DomainStorageMap) ReadOnlyLoadedValueIterator() DomainStorageMapIterato
374374
}
375375

376376
return DomainStorageMapIterator{
377-
mapIterator: mapLoadedValueIterator{
378-
MapLoadedValueIterator: mapIterator,
379-
},
380-
storage: s.orderedMap.Storage,
377+
mapIterator: mapIterator,
378+
storage: s.orderedMap.Storage,
381379
}
382380
}
383381

@@ -459,23 +457,3 @@ func (i DomainStorageMapIterator) NextValue(gauge common.Gauge) Value {
459457

460458
return MustConvertStoredValue(gauge, v)
461459
}
462-
463-
type mapLoadedValueIterator struct {
464-
*atree.MapLoadedValueIterator
465-
}
466-
467-
var _ atree.MapIterator = mapLoadedValueIterator{}
468-
469-
func (i mapLoadedValueIterator) CanMutate() bool {
470-
return false
471-
}
472-
473-
func (i mapLoadedValueIterator) NextKey() (atree.Value, error) {
474-
key, _, err := i.Next()
475-
return key, err
476-
}
477-
478-
func (i mapLoadedValueIterator) NextValue() (atree.Value, error) {
479-
_, value, err := i.Next()
480-
return value, err
481-
}

tools/compatibility-check/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ require (
4343
github.com/multiformats/go-multibase v0.2.0 // indirect
4444
github.com/multiformats/go-multihash v0.2.3 // indirect
4545
github.com/multiformats/go-varint v0.0.7 // indirect
46-
github.com/onflow/atree v0.13.1-0.20260305200207-dad78366916d // indirect
46+
github.com/onflow/atree v0.14.0 // indirect
4747
github.com/onflow/crypto v0.25.3 // indirect
4848
github.com/onflow/fixed-point v0.1.1 // indirect
4949
github.com/onflow/flow-core-contracts/lib/go/templates v1.9.2 // indirect

tools/compatibility-check/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
347347
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
348348
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
349349
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
350-
github.com/onflow/atree v0.13.1-0.20260305200207-dad78366916d h1:lcP5qPEKL6xDVyQ5xAjr6EvO/q9cT5hT7gpjmV1pgfs=
351-
github.com/onflow/atree v0.13.1-0.20260305200207-dad78366916d/go.mod h1:qdZcfLQwPirHcNpLiK+2t3KAo+SAb9Si6TqurE6pykE=
350+
github.com/onflow/atree v0.14.0 h1:VFrvRsDBfBujviAseIYFb/KCo2mD4chcM7LpGbcCDdM=
351+
github.com/onflow/atree v0.14.0/go.mod h1:qdZcfLQwPirHcNpLiK+2t3KAo+SAb9Si6TqurE6pykE=
352352
github.com/onflow/crypto v0.25.3 h1:XQ3HtLsw8h1+pBN+NQ1JYM9mS2mVXTyg55OldaAIF7U=
353353
github.com/onflow/crypto v0.25.3/go.mod h1:+1igaXiK6Tjm9wQOBD1EGwW7bYWMUGKtwKJ/2QL/OWs=
354354
github.com/onflow/fixed-point v0.1.1 h1:j0jYZVO8VGyk1476alGudEg7XqCkeTVxb5ElRJRKS90=

0 commit comments

Comments
 (0)