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

Merge master into Cadence 1.0 feature branch #5540

Merged
merged 160 commits into from
Mar 12, 2024

Conversation

turbolent
Copy link
Member

Conflict resolution:
commit 5fa88d6bd7c6da94786b650dd19bc483c87d2a09
Merge: 8aebe84786 50761d4a82
Author: Bastian Müller <bastian@turbolent.com>
Date:   Mon Mar 11 18:31:31 2024 -0700

    Merge branch 'master' into bastian/update-stable-cadence-13

diff --git a/fvm/evm/evm_test.go b/fvm/evm/evm_test.go
remerge CONFLICT (content): Merge conflict in fvm/evm/evm_test.go
index 97d68d4e6b..15f8a71561 100644
--- a/fvm/evm/evm_test.go
+++ b/fvm/evm/evm_test.go
@@ -485,15 +485,10 @@ func TestCadenceOwnedAccountFunctionalities(t *testing.T) {
 				import FlowToken from %s
 
 				access(all)
-<<<<<<< 8aebe84786 (Merge pull request #5539 from onflow/auto-update-onflow-cadence-v1.0.0-preview.12)
-				fun main(): [UInt8; 20] {
+				fun main(address: [UInt8; 20]): UFix64 {
 					let admin = getAuthAccount<auth(BorrowValue) &Account>(%s)
 						.storage.borrow<&FlowToken.Administrator>(from: /storage/flowTokenAdmin)!
-=======
-				fun main(address: [UInt8; 20]): UFix64 {
-					let admin = getAuthAccount(%s)
-						.borrow<&FlowToken.Administrator>(from: /storage/flowTokenAdmin)!
->>>>>>> 50761d4a82 (Merge pull request #5256 from AndriiDiachuk/AndriiDiachuk/access-add-support-for-indexing-execution-data)
+
 					let minter <- admin.createNewMinter(allowedAmount: 2.34)
 					let vault <- minter.mintTokens(amount: 2.34)
 					destroy minter
@@ -722,44 +717,6 @@ func TestCadenceArch(t *testing.T) {
 				require.NoError(t, err)
 				flowAccount := accounts[0]
 
-<<<<<<< 8aebe84786 (Merge pull request #5539 from onflow/auto-update-onflow-cadence-v1.0.0-preview.12)
-				// create a COA and store it under flow account
-				script := []byte(fmt.Sprintf(
-					`
-					import EVM from %s
-
-					transaction {
-						prepare(account: auth(Capabilities, SaveValue) &Account) {
-							let cadenceOwnedAccount <- EVM.createCadenceOwnedAccount()
-
-							account.storage.save(
-                                <-cadenceOwnedAccount,
-								to: /storage/coa
-                            )
-
-							let cap = account.capabilities.storage
-							    .issue<&EVM.CadenceOwnedAccount>(/storage/coa)
-							account.capabilities.publish(cap, at: /public/coa)
-						}
-					}
-                `,
-					sc.EVMContract.Address.HexWithPrefix(),
-				))
-
-				tx := fvm.Transaction(
-					flow.NewTransactionBody().
-						SetScript(script).
-						AddAuthorizer(account),
-					0)
-				es, output, err := vm.Run(ctx, tx, snapshot)
-				require.NoError(t, err)
-				require.NoError(t, output.Err)
-				snapshot = snapshot.Append(es)
-
-				// 3rd event is the cadence owned account created event
-				coaAddress, err := types.COAAddressFromFlowEvent(sc.EVMContract.Address, output.Events[2])
-				require.NoError(t, err)
-=======
 				// create/store/link coa
 				coaAddress, snapshot := setupCOA(
 					t,
@@ -769,7 +726,6 @@ func TestCadenceArch(t *testing.T) {
 					flowAccount,
 					0,
 				)
->>>>>>> 50761d4a82 (Merge pull request #5256 from AndriiDiachuk/AndriiDiachuk/access-add-support-for-indexing-execution-data)
 
 				data := RandomCommonHash(t)
 
@@ -927,19 +883,24 @@ func setupCOA(
 	import FlowToken from %s
 
 	transaction(amount: UFix64) {
-		prepare(account: AuthAccount) {
+		prepare(account: auth(Capabilities, Storage) &Account) {
 			let cadenceOwnedAccount1 <- EVM.createCadenceOwnedAccount()
 			
-			let vaultRef = account.borrow<&FlowToken.Vault>(from: /storage/flowTokenVault)
+			let vaultRef = account.storage
+                .borrow<auth(FungibleToken.Withdraw) &FlowToken.Vault>(from: /storage/flowTokenVault)
 				?? panic("Could not borrow reference to the owner's Vault!")
 
 			let vault <- vaultRef.withdraw(amount: amount) as! @FlowToken.Vault
 			cadenceOwnedAccount1.deposit(from: <-vault)
 			
-			account.save<@EVM.CadenceOwnedAccount>(<-cadenceOwnedAccount1,
-												to: /storage/coa)
-			account.link<&EVM.CadenceOwnedAccount{EVM.Addressable}>(/public/coa,
-																target: /storage/coa)
+			account.storage.save<@EVM.CadenceOwnedAccount>(
+				<-cadenceOwnedAccount1,
+				to: /storage/coa
+			)
+
+			let cap = account.capabilities.storage
+				.issue<&EVM.CadenceOwnedAccount>(/storage/coa)
+			account.capabilities.publish(cap, at: /public/coa)
 		}
 	}
 	`,

AndriiDiachuk and others added 30 commits January 9, 2024 16:58
…o AndriiDiachuk/access-add-support-for-indexing-execution-data
Co-authored-by: Leo Zhang <zhangchiqing@gmail.com>
kc1116 and others added 18 commits March 6, 2024 10:47
Add Windows support when compiling with CGO_ENABLED
…on-indexer

[Execution] Remove duplicated observer collection indexer
…support-for-indexing-execution-data

[Access] Add support for indexing execution data on Observers
@codecov-commenter
Copy link

codecov-commenter commented Mar 12, 2024

Codecov Report

Attention: Patch coverage is 52.79188% with 186 lines in your changes are missing coverage. Please review.

Project coverage is 55.89%. Comparing base (a0b44e9) to head (932cf3a).

Files Patch % Lines
...chronization/indexer/collection_executed_metric.go 14.63% 68 Missing and 2 partials ⚠️
tools/test_matrix_generator/matrix.go 74.56% 29 Missing ⚠️
fvm/evm/handler/handler.go 35.29% 16 Missing and 6 partials ⚠️
...dule/state_synchronization/indexer/indexer_core.go 64.28% 12 Missing and 3 partials ⚠️
module/mempool/queue/messageEntity.go 41.66% 14 Missing ⚠️
fvm/evm/emulator/emulator.go 74.35% 6 Missing and 4 partials ⚠️
fvm/evm/types/chainIDs.go 0.00% 7 Missing ⚠️
module/mempool/queue/heroStore.go 57.14% 5 Missing and 1 partial ⚠️
engine/access/ingestion/engine.go 75.00% 5 Missing ⚠️
module/metrics/noop.go 0.00% 3 Missing ⚠️
... and 3 more
Additional details and impacted files
@@                    Coverage Diff                     @@
##           feature/stable-cadence    #5540      +/-   ##
==========================================================
- Coverage                   55.92%   55.89%   -0.04%     
==========================================================
  Files                        1047     1049       +2     
  Lines                      103037   103114      +77     
==========================================================
+ Hits                        57623    57633      +10     
- Misses                      41021    41093      +72     
+ Partials                     4393     4388       -5     
Flag Coverage Δ
unittests 55.89% <52.79%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@turbolent turbolent merged commit 25d0a9f into feature/stable-cadence Mar 12, 2024
55 checks passed
@turbolent turbolent deleted the bastian/update-stable-cadence-13 branch March 12, 2024 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants