Skip to content

Commit

Permalink
Merge pull request #3259 from onflow/bastian/update-atree-register-in…
Browse files Browse the repository at this point in the history
…lining-v1.0
  • Loading branch information
turbolent authored Apr 17, 2024
2 parents 8bb9cdb + 187eda8 commit 8ad7730
Show file tree
Hide file tree
Showing 77 changed files with 1,710 additions and 913 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ require (
require (
github.com/SaveTheRbtz/mph v0.1.1-0.20240117162131-4166ec7869bc
github.com/k0kubun/pp v3.0.1+incompatible
github.com/kodova/html-to-markdown v1.0.1
github.com/onflow/crypto v0.25.0
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc
)
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
github.com/PuerkitoBio/goquery v1.5.0/go.mod h1:qD2PgZ9lccMbQlc7eEOjaeRlFQON7xY8kdmcsrnKqMg=
github.com/SaveTheRbtz/mph v0.1.1-0.20240117162131-4166ec7869bc h1:DCHzPQOcU/7gwDTWbFQZc5qHMPS1g0xTO56k8NXsv9M=
github.com/SaveTheRbtz/mph v0.1.1-0.20240117162131-4166ec7869bc/go.mod h1:LJM5a3zcIJ/8TmZwlUczvROEJT8ntOdhdG9jjcR1B0I=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
github.com/bits-and-blooms/bitset v1.5.0 h1:NpE8frKRLGHIcEzkR+gZhiioW1+WbYV6fKwD6ZIpQT8=
github.com/bits-and-blooms/bitset v1.5.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
github.com/bytecodealliance/wasmtime-go/v7 v7.0.0 h1:/rBNjgFju2HCZnkPb1eL+W4GBwP8DMbaQu7i+GR9DH4=
Expand Down Expand Up @@ -36,6 +38,8 @@ github.com/k0kubun/pp/v3 v3.2.0/go.mod h1:ODtJQbQcIRfAD3N+theGCV1m/CBxweERz2dapd
github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c=
github.com/klauspost/cpuid/v2 v2.2.0 h1:4ZexSFt8agMNzNisrsilL6RClWDC5YJnLHNIfTy4iuc=
github.com/klauspost/cpuid/v2 v2.2.0/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
github.com/kodova/html-to-markdown v1.0.1 h1:MJxQAnqxtss3DaPnm72DRV65HZiMQZF3DUAfEaTg+14=
github.com/kodova/html-to-markdown v1.0.1/go.mod h1:NhDrT7QdSrdpezFg/0EQx9zeobCHR5oAguzrKrC6mVU=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
Expand Down Expand Up @@ -126,9 +130,12 @@ golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPI
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191109021931-daa7c04131f5/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
Expand Down Expand Up @@ -172,6 +179,7 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI=
Expand Down
54 changes: 28 additions & 26 deletions migrations/capcons/migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ func (t *testMigrationReporter) MissingTarget(
)
}

func (t *testMigrationReporter) DictionaryKeyConflict(addressPath interpreter.AddressPath) {
// For testing purposes, record the conflict as an error
t.errors = append(t.errors, fmt.Errorf("dictionary key conflict: %s", addressPath))
}

const testPathIdentifier = "test"

var testAddress = common.MustBytesToAddress([]byte{0x1})
Expand Down Expand Up @@ -454,14 +459,14 @@ func testPathCapabilityValueMigration(

// Migrate

migration := migrations.NewStorageMigration(inter, storage, "test")

capabilityMapping := &CapabilityMapping{}
migration, err := migrations.NewStorageMigration(inter, storage, "test", testAddress)
require.NoError(t, err)

reporter := &testMigrationReporter{}

migration.MigrateAccount(
testAddress,
capabilityMapping := &CapabilityMapping{}

migration.Migrate(
migration.NewValueMigrationsPathMigrator(
reporter,
&LinkValueMigration{
Expand All @@ -472,8 +477,7 @@ func testPathCapabilityValueMigration(
),
)

migration.MigrateAccount(
testAddress,
migration.Migrate(
migration.NewValueMigrationsPathMigrator(
reporter,
&CapabilityValueMigration{
Expand Down Expand Up @@ -1298,14 +1302,14 @@ func testLinkMigration(

// Migrate

migration := migrations.NewStorageMigration(inter, storage, "test")

capabilityMapping := &CapabilityMapping{}
migration, err := migrations.NewStorageMigration(inter, storage, "test", testAddress)
require.NoError(t, err)

reporter := &testMigrationReporter{}

migration.MigrateAccount(
testAddress,
capabilityMapping := &CapabilityMapping{}

migration.Migrate(
migration.NewValueMigrationsPathMigrator(
reporter,
&LinkValueMigration{
Expand Down Expand Up @@ -2007,14 +2011,14 @@ func TestPublishedPathCapabilityValueMigration(t *testing.T) {

// Migrate

migration := migrations.NewStorageMigration(inter, storage, "test")

capabilityMapping := &CapabilityMapping{}
migration, err := migrations.NewStorageMigration(inter, storage, "test", testAddress)
require.NoError(t, err)

reporter := &testMigrationReporter{}

migration.MigrateAccount(
testAddress,
capabilityMapping := &CapabilityMapping{}

migration.Migrate(
migration.NewValueMigrationsPathMigrator(
reporter,
&LinkValueMigration{
Expand All @@ -2025,8 +2029,7 @@ func TestPublishedPathCapabilityValueMigration(t *testing.T) {
),
)

migration.MigrateAccount(
testAddress,
migration.Migrate(
migration.NewValueMigrationsPathMigrator(
reporter,
&CapabilityValueMigration{
Expand Down Expand Up @@ -2248,14 +2251,14 @@ func TestUntypedPathCapabilityValueMigration(t *testing.T) {

// Migrate

migration := migrations.NewStorageMigration(inter, storage, "test")

capabilityMapping := &CapabilityMapping{}
migration, err := migrations.NewStorageMigration(inter, storage, "test", testAddress)
require.NoError(t, err)

reporter := &testMigrationReporter{}

migration.MigrateAccount(
testAddress,
capabilityMapping := &CapabilityMapping{}

migration.Migrate(
migration.NewValueMigrationsPathMigrator(
reporter,
&LinkValueMigration{
Expand All @@ -2266,8 +2269,7 @@ func TestUntypedPathCapabilityValueMigration(t *testing.T) {
),
)

migration.MigrateAccount(
testAddress,
migration.Migrate(
migration.NewValueMigrationsPathMigrator(
reporter,
&CapabilityValueMigration{
Expand Down
10 changes: 2 additions & 8 deletions migrations/entitlements/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,9 @@ func ConvertToEntitledType(
break

default:
newAuth := sema.UnauthorizedAccess
supportedEntitlements := entitlementSupportingType.SupportedEntitlements()
if supportedEntitlements.Len() > 0 {
newAuth = sema.EntitlementSetAccess{
SetKind: sema.Conjunction,
Entitlements: supportedEntitlements,
}
}
auth = interpreter.ConvertSemaAccessToStaticAuthorization(inter, newAuth)
newAccess := sema.NewAccessFromEntitlementSet(supportedEntitlements, sema.Conjunction)
auth = interpreter.ConvertSemaAccessToStaticAuthorization(inter, newAccess)
returnNew = true
}
}
Expand Down
Loading

0 comments on commit 8ad7730

Please sign in to comment.