Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update atree inlining cadence v1.0 #3467

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
785e242
v1.0.0-preview.36
turbolent Jul 8, 2024
c952163
add some more tests for string functions
turbolent Jul 8, 2024
76eeaf2
Merge pull request #3453 from onflow/bastian/more-string-tests
turbolent Jul 8, 2024
8565154
Merge pull request #3452 from onflow/release/v1.0.0-preview.36
turbolent Jul 8, 2024
b48e8e2
add a String.contains function
turbolent Jul 8, 2024
1fcafe0
optimize String.contains, add helpers for grapheme cluster boundaries
turbolent Jul 8, 2024
156dd3b
Merge pull request #3455 from onflow/bastian/add-string-contains
turbolent Jul 9, 2024
a369c56
add String.index and String.count, fix grapheme boundary functions
turbolent Jul 9, 2024
9026f67
Merge pull request #3456 from onflow/bastian/string-index-and-count
turbolent Jul 9, 2024
c880217
fix String.split: split into characters (grapheme clusters)
turbolent Jul 9, 2024
e27955a
improve tests
turbolent Jul 9, 2024
6e96083
fix String.replaceAll: replace characters (grapheme clusters)
turbolent Jul 9, 2024
33bf58a
Merge pull request #3457 from onflow/bastian/fix-string-split
turbolent Jul 10, 2024
86215c4
Merge branch 'master' into bastian/fix-string-replaceall
turbolent Jul 10, 2024
c145b9f
Merge pull request #3458 from onflow/bastian/fix-string-replaceall
turbolent Jul 10, 2024
1adb252
emit events when capability controllers are issued
turbolent Jul 10, 2024
175f97d
fix account link migration
turbolent Jul 10, 2024
cafa40d
add staged contracts report 07-10
zhangchiqing Jul 11, 2024
af9ec8e
Merge pull request #3462 from onflow/leo/add-staged-contracts-report-…
turbolent Jul 11, 2024
aee7c42
add root block for migration 07-10
zhangchiqing Jul 11, 2024
0d8f495
Merge pull request #3463 from onflow/leo/add-root-block-id-for-migrat…
turbolent Jul 11, 2024
306a9a5
emit events for capability controller deletions
turbolent Jul 11, 2024
6014fbe
remove unused function
turbolent Jul 11, 2024
96385b9
emit StorageCapabilityControllerTargetChanged for StorageCapabilityCo…
turbolent Jul 11, 2024
ee5e3a1
emit event when capability is published and unpublished
turbolent Jul 11, 2024
38a2e4d
Merge pull request #3460 from onflow/bastian/3459-emit-capcon-issue-e…
turbolent Jul 12, 2024
3caa69b
Merge branch 'master' into bastian/fix-account-link-migration
turbolent Jul 12, 2024
80f0dba
Merge pull request #3461 from onflow/bastian/fix-account-link-migration
turbolent Jul 12, 2024
df519bd
Merge branch 'master' into bastian/3459-emit-capcon-issue-events-2
turbolent Jul 12, 2024
dfa3208
Merge pull request #3464 from onflow/bastian/3459-emit-capcon-issue-e…
turbolent Jul 12, 2024
2fc95e5
v1.0.0-preview.37
turbolent Jul 12, 2024
b299de4
Merge pull request #3466 from onflow/release/v1.0.0-preview.37
turbolent Jul 12, 2024
15cb429
Merge branch 'master' into bastian/update-atree-inlining-cadence-v1.0-12
turbolent Jul 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions migrations/capcons/capabilitymigration.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@ func (m *CapabilityValueMigration) Migrate(
panic(errors.NewUnexpectedError("unexpected non-reference borrow type: %T", oldBorrowType))
}

// Convert the old AuthAccount type to the new fully-entitled Account type
if newBorrowType.ReferencedType == interpreter.PrimitiveStaticTypeAuthAccount { //nolint:staticcheck
newBorrowType = fullyEntitledAccountReferenceStaticType
}

newCapability := interpreter.NewUnmeteredCapabilityValue(
capabilityID,
oldCapability.Address,
Expand Down
28 changes: 15 additions & 13 deletions migrations/capcons/linkmigration.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ type LinkMigrationReporter interface {

// LinkValueMigration migrates all links to capability controllers.
type LinkValueMigration struct {
CapabilityMapping *CapabilityMapping
AccountIDGenerator stdlib.AccountIDGenerator
Reporter LinkMigrationReporter
CapabilityMapping *CapabilityMapping
IssueHandler stdlib.CapabilityControllerIssueHandler
Handler stdlib.CapabilityControllerHandler
Reporter LinkMigrationReporter
}

var _ migrations.ValueMigration = &LinkValueMigration{}
Expand Down Expand Up @@ -98,7 +99,7 @@ func (m *LinkValueMigration) Migrate(
}

reporter := m.Reporter
accountIDGenerator := m.AccountIDGenerator
issueHandler := m.IssueHandler

locationRange := interpreter.EmptyLocationRange

Expand Down Expand Up @@ -180,7 +181,7 @@ func (m *LinkValueMigration) Migrate(
capabilityID, _ = stdlib.IssueStorageCapabilityController(
inter,
locationRange,
accountIDGenerator,
issueHandler,
accountAddress,
borrowType,
targetPath,
Expand All @@ -190,7 +191,7 @@ func (m *LinkValueMigration) Migrate(
capabilityID, _ = stdlib.IssueAccountCapabilityController(
inter,
locationRange,
accountIDGenerator,
issueHandler,
accountAddress,
borrowType,
)
Expand Down Expand Up @@ -237,10 +238,10 @@ func storageKeyToPathValue(
return interpreter.NewUnmeteredPathValue(domain, identifier), true
}

var authAccountReferenceStaticType = interpreter.NewReferenceStaticType(
var unauthorizedAccountReferenceStaticType = interpreter.NewReferenceStaticType(
nil,
interpreter.UnauthorizedAccess,
interpreter.PrimitiveStaticTypeAuthAccount, //nolint:staticcheck
interpreter.PrimitiveStaticTypeAccount,
)

func (m *LinkValueMigration) getPathCapabilityFinalTarget(
Expand All @@ -253,6 +254,7 @@ func (m *LinkValueMigration) getPathCapabilityFinalTarget(
authorization interpreter.Authorization,
err error,
) {
handler := m.Handler

locationRange := interpreter.EmptyLocationRange

Expand Down Expand Up @@ -309,10 +311,9 @@ func (m *LinkValueMigration) getPathCapabilityFinalTarget(
pathValue = targetPath

case interpreter.AccountLinkValue: //nolint:staticcheck
if !inter.IsSubTypeOfSemaType(
authAccountReferenceStaticType,
wantedBorrowType,
) {
allowedType := unauthorizedAccountReferenceStaticType

if !inter.IsSubTypeOfSemaType(allowedType, wantedBorrowType) {
return nil, interpreter.UnauthorizedAccess, nil
}

Expand Down Expand Up @@ -343,11 +344,12 @@ func (m *LinkValueMigration) getPathCapabilityFinalTarget(
// just get target address/path
reference := stdlib.GetCheckedCapabilityControllerReference(
inter,
locationRange,
value.Address,
value.ID,
wantedBorrowType,
capabilityBorrowType,
locationRange,
handler,
)
if reference == nil {
return nil, interpreter.UnauthorizedAccess, nil
Expand Down
Loading
Loading