Illia malachyn/embed scripts to rosetta - #66
Conversation
|
Warning Rate limit exceeded@illia-malachyn has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 28 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThis pull request introduces several new functionalities to the Flow blockchain ecosystem. It includes a smart contract function for computing transaction fees based on specified efforts, a function for retrieving public keys from user vaults, and a transaction for creating accounts with multiple public keys. Additionally, it updates the Go script to utilize embedded Cadence scripts, enhancing maintainability. Configuration files are also modified to reflect new spork identifiers and root block values. Changes
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
bf7e5c4 to
f5b3065
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
Outside diff range, codebase verification and nitpick comments (7)
script/script.go (7)
87-88: Incorrect file path in go:embed directive.The
go:embeddirective specifies the pathcadence/transactions/proxy-contract-update.cdc, but the actual file is located atscript/cadence/transactions/proxy-contract-update.cdc. Please update the path in the directive to ensure the file is correctly embedded.
- Update the path in the
go:embeddirective toscript/cadence/transactions/proxy-contract-update.cdc.Analysis chain
Embed directive correctly applied to SetContract.
The
go:embeddirective has been correctly applied to theSetContractvariable. Please verify that the path to thecadence/transactions/proxy-contract-update.cdcfile is correct and that the file exists.Run the following script to verify the file existence:
#!/bin/bash # Description: </details> <details> <summary>Scripts executed</summary> The following scripts were executed for the analysis: --- Script: ```shell #!/bin/bash # Check for the existence of the file `proxy-contract-update.cdc` in the `cadence/transactions` directory. fd 'proxy-contract-update.cdc' --glob 'cadence/transactions'Length of output: 166
Script:
#!/bin/bash # Search for the file `proxy-contract-update.cdc` across the entire repository. fd 'proxy-contract-update.cdc'Length of output: 84
20-21: Incorrect path in go:embed directive for BasicTransfer.The
go:embeddirective specifies the path ascadence/transactions/basic-transfer.cdc, but the actual path isscript/cadence/transactions/basic-transfer.cdc. Please update the path in the directive to ensure the file is correctly embedded.
- Update the path in the
go:embeddirective toscript/cadence/transactions/basic-transfer.cdc.Analysis chain
Embed directive correctly applied to BasicTransfer.
The
go:embeddirective has been correctly applied to theBasicTransfervariable. Please verify that the path to thecadence/transactions/basic-transfer.cdcfile is correct and that the file exists.Run the following script to verify the file existence:
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the embedded file. # Test: Check if the file exists. Expect: File exists. fd 'basic-transfer.cdc' 'cadence/transactions'Length of output: 152
Script:
#!/bin/bash # Description: Search for the basic-transfer.cdc file across the entire repository. # Test: Locate the file. Expect: File path is returned if it exists. fd 'basic-transfer.cdc'Length of output: 70
37-38: Incorrect file path in go:embed directive.The
create-proxy-account.cdcfile exists in the repository atscript/cadence/transactions/create-proxy-account.cdc. Please update thego:embeddirective to use the correct path.
- Update the path in the
go:embeddirective toscript/cadence/transactions/create-proxy-account.cdc.Analysis chain
Embed directive correctly applied to CreateProxyAccount.
The
go:embeddirective has been correctly applied to theCreateProxyAccountvariable. Please verify that the path to thecadence/transactions/create-proxy-account.cdcfile is correct and that the file exists.Run the following script to verify the file existence:
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the embedded file. # Test: Check if the file exists. Expect: File exists. fd 'create-proxy-account.cdc' 'cadence/transactions'Length of output: 158
Script:
#!/bin/bash # Description: Search for the 'create-proxy-account.cdc' file across the entire repository. # Test: Locate the file. Expect: File path is returned if it exists. fd 'create-proxy-account.cdc'Length of output: 82
50-51: Update the embed path for GetBalances.The
get-balances.cdcfile exists atscript/cadence/scripts/get-balances.cdc. Please update thego:embeddirective to use this correct path to ensure proper embedding.
- Update the path in the
go:embeddirective toscript/cadence/scripts/get-balances.cdc.Analysis chain
Embed directive correctly applied to GetBalances.
The
go:embeddirective has been correctly applied to theGetBalancesvariable. Please verify that the path to thecadence/scripts/get-balances.cdcfile is correct and that the file exists.Run the following script to verify the file existence:
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the embedded file. # Test: Check if the file exists. Expect: File exists. fd 'get-balances.cdc' 'cadence/scripts'Length of output: 140
Script:
#!/bin/bash # Description: Search for the get-balances.cdc file across the entire repository. # Test: Check if the file exists anywhere in the repository. Expect: File exists. fd 'get-balances.cdc'Length of output: 61
25-26: Correct the path in the go:embed directive.The file
compute-fees.cdcexists atscript/cadence/scripts/compute-fees.cdc. Please update the path in thego:embeddirective to reflect this location:
- Change
cadence/scripts/compute-fees.cdctoscript/cadence/scripts/compute-fees.cdcin thego:embeddirective.Analysis chain
Embed directive correctly applied to ComputeFees.
The
go:embeddirective has been correctly applied to theComputeFeesvariable. Please verify that the path to thecadence/scripts/compute-fees.cdcfile is correct and that the file exists.Run the following script to verify the file existence:
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the embedded file. # Test: Check if the file exists. Expect: File exists. fd 'compute-fees.cdc' 'cadence/scripts'Length of output: 140
Script:
#!/bin/bash # Description: Search for the compute-fees.cdc file across the entire repository. # Test: Search for the file. Expect: File found. fd 'compute-fees.cdc'Length of output: 61
31-32: Incorrect path in go:embed directive for CreateAccount.The
create-account.cdcfile exists atscript/cadence/transactions/create-account.cdc, but thego:embeddirective specifies the path ascadence/transactions/create-account.cdc. Please update the path in the directive to include thescript/prefix to ensure it functions correctly.
- Update the path in the
go:embeddirective toscript/cadence/transactions/create-account.cdc.Analysis chain
Embed directive correctly applied to CreateAccount.
The
go:embeddirective has been correctly applied to theCreateAccountvariable. Please verify that the path to thecadence/transactions/create-account.cdcfile is correct and that the file exists.Run the following script to verify the file existence:
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the embedded file. # Test: Check if the file exists. Expect: File exists. fd 'create-account.cdc' 'cadence/transactions'Length of output: 152
Script:
#!/bin/bash # Description: Search for the create-account.cdc file across the entire repository. # Test: Check if the file exists anywhere in the repository. Expect: File exists. fd 'create-account.cdc'Length of output: 70
66-67: Correct the path in the go:embed directive.The file
get-proxy-nonce.cdcexists atscript/cadence/scripts/get-proxy-nonce.cdc. Please update thego:embeddirective to use this correct path to ensure the file is embedded properly.
- Incorrect path:
cadence/scripts/get-proxy-nonce.cdc- Correct path:
script/cadence/scripts/get-proxy-nonce.cdcAnalysis chain
Embed directive correctly applied to GetProxyNonce.
The
go:embeddirective has been correctly applied to theGetProxyNoncevariable. Please verify that the path to thecadence/scripts/get-proxy-nonce.cdcfile is correct and that the file exists.Run the following script to verify the file existence:
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the embedded file. # Test: Check if the file exists. Expect: File exists. fd 'get-proxy-nonce.cdc' 'cadence/scripts'Length of output: 143
Script:
#!/bin/bash # Description: Search for the get-proxy-nonce.cdc file across the entire repository. # Test: Check if the file exists anywhere in the repository. fd 'get-proxy-nonce.cdc'Length of output: 67
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- script/cadence/scripts/compute-fees.cdc (1 hunks)
- script/cadence/scripts/get-proxy-public-key.cdc (1 hunks)
- script/cadence/transactions/create-account.cdc (1 hunks)
- script/script.go (2 hunks)
- testnet-clone.json (1 hunks)
- testnet.json (1 hunks)
Additional comments not posted (8)
script/cadence/scripts/compute-fees.cdc (1)
1-5: Well-structured and clear function implementation.The function
mainis well-implemented with clear usage of named parameters, enhancing readability and reducing potential errors. The import statement is correctly placed and used.testnet-clone.json (2)
27-27: Root block updated correctly.The "root_block" value has been updated from 185185854 to 211176670. Please verify the correctness of this value with the blockchain state.
Run the following script to verify the root block value:
21-27: Spork identifier updated correctly.The spork identifier has been updated from "50" to "51". Please ensure that this change is reflected across all relevant configuration files and systems.
Run the following script to verify the spork usage:
Verification successful
Spork identifier updated correctly across the codebase.
The spork identifier "50" is not present in the codebase, confirming that the update to "51" has been successfully applied across all files. No further action is required.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all configuration files reflect the new spork identifier. # Test: Search for the old spork identifier. Expect: No occurrences. rg --type json -A 5 $'\"50\"'Length of output: 28
Script:
#!/bin/bash # Description: Verify all files reflect the new spork identifier. # Test: Search for the old spork identifier across all file types. Expect: No occurrences. rg -A 5 '"50"'Length of output: 16
testnet.json (2)
29-29: Root block updated correctly.The "root_block" value has been updated from 185185854 to 211176670. Please verify the correctness of this value with the blockchain state.
Run the following script to verify the root block value:
Verification successful
Root block value updated successfully.
The new "root_block" value (211176670) is correctly present in the
testnet.jsonfile, confirming the update was applied as intended. No further issues were found.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of the "root_block" value. # Test: Search for the old root block value. Expect: No occurrences. rg --type json -A 5 $'185185854'Length of output: 31
Script:
#!/bin/bash # Description: Verify the presence of the new "root_block" value. # Test: Search for the new root block value. Expect: At least one occurrence. rg --type json -A 5 $'211176670'Length of output: 354
23-29: Spork identifier updated correctly.The spork identifier has been updated from "50" to "51". Please ensure that this change is reflected across all relevant configuration files and systems.
Run the following script to verify the spork usage:
Verification successful
Spork identifier update verified successfully.
The old spork identifier "50" is no longer present, and the new spork identifier "51" is correctly reflected in the relevant configuration files, such as
testnet.jsonandtestnet-clone.json. The update appears to be consistent and complete.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all configuration files reflect the new spork identifier. # Test: Search for the old spork identifier. Expect: No occurrences. rg --type json -A 5 $'\"50\"'Length of output: 28
Script:
#!/bin/bash # Description: Verify all configuration files reflect the new spork identifier. # Test: Search for the old spork identifier. Expect: No occurrences. rg --type json -A 5 $'\"50\"' # Test: Search for the new spork identifier. Expect: Occurrences in relevant files. rg --type json -A 5 $'\"51\"'Length of output: 585
script/script.go (3)
75-76: Embed directive correctly applied to GetProxyPublicKey.The
go:embeddirective has been correctly applied to theGetProxyPublicKeyvariable. Please verify that the path to thecadence/scripts/get-proxy-public-key.cdcfile is correct and that the file exists.Run the following script to verify the file existence:
Verification successful
File
get-proxy-public-key.cdcexists and path is correct.The file
get-proxy-public-key.cdcwas found at the pathscript/cadence/scripts/get-proxy-public-key.cdc, confirming that thego:embeddirective is correctly referencing the file. No further action is needed.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the embedded file. # Test: Check if the file exists. Expect: File exists. fd 'get-proxy-public-key.cdc' 'cadence/scripts'Length of output: 148
Script:
#!/bin/bash # Description: Search for the file `get-proxy-public-key.cdc` across the entire repository. # Test: Check if the file exists anywhere in the repository. fd 'get-proxy-public-key.cdc'Length of output: 77
56-57: Embed directive correctly applied to GetBalancesBasic.The
go:embeddirective has been correctly applied to theGetBalancesBasicvariable. Please verify that the path to thecadence/scripts/get-balances-basic.cdcfile is correct and that the file exists.Run the following script to verify the file existence:
Verification successful
File
get-balances-basic.cdcsuccessfully located.The file
get-balances-basic.cdchas been found atscript/cadence/scripts/get-balances-basic.cdc, confirming that thego:embeddirective is correctly referencing an existing file. No further action is needed.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the embedded file. # Test: Check if the file exists. Expect: File exists. fd 'get-balances-basic.cdc' 'cadence/scripts'Length of output: 146
Script:
#!/bin/bash # Description: Search for the 'get-balances-basic.cdc' file in the entire repository. # Test: Check if the file exists anywhere in the repository. fd 'get-balances-basic.cdc'Length of output: 73
81-82: Embed directive correctly applied to ProxyTransfer.The
go:embeddirective has been correctly applied to theProxyTransfervariable. Please verify that the path to thecadence/transactions/proxy-transfer.cdcfile is correct and that the file exists.Run the following script to verify the file existence:
Verification successful
Embed directive correctly references existing file.
The
proxy-transfer.cdcfile exists at the specified path, and thego:embeddirective is correctly applied. No further action is needed regarding the file path.
- File path:
script/cadence/transactions/proxy-transfer.cdcScripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the embedded file. # Test: Check if the file exists. Expect: File exists. fd 'proxy-transfer.cdc' 'cadence/transactions'Length of output: 152
Script:
#!/bin/bash # Description: Verify the existence of the directory and the embedded file. # Test 1: Check if the 'cadence' directory exists. fd --type d 'cadence' # Test 2: Check if the 'proxy-transfer.cdc' file exists anywhere in the repository. fd 'proxy-transfer.cdc'Length of output: 108
| "address": "access.devnet.nodes.onflow.org:9000" | ||
| } | ||
| ], | ||
| "root_block": 185185854, |
There was a problem hiding this comment.
Be sure to double-check that these values are correct. Thanks for the cleanup!!
There was a problem hiding this comment.
I took them from here https://github.com/onflow/flow/blob/master/sporks.json#L1309
Summary by CodeRabbit
New Features
Chores