Conversation
PR SummaryIntroduced a Kotlin DSL for building and sending Flow transactions, mirroring the flow-swift builder style. Added helper functions for extracting created account addresses from transaction results, new Cadence query utilities for child accounts, token balances, and staking info. Enhanced EVM manager with Changes
autogenerated by presubmit.ai |
There was a problem hiding this comment.
🚨 Pull request needs attention.
Review Summary
Commits Considered (4)
Files Processed (30)
- .gitignore (1 hunk)
- flow/src/androidMain/kotlin/org/onflow/flow/crypto/Crypto.kt (2 hunks)
- flow/src/androidMain/kotlin/org/onflow/flow/infrastructure/scripts/ContractAddressRegister.kt (4 hunks)
- flow/src/androidMain/resources/scripts/common/addresses.json (1 hunk)
- flow/src/androidMain/resources/scripts/common/child/get_child_account_meta.cdc (1 hunk)
- flow/src/androidMain/resources/scripts/common/child/get_child_addresses.cdc (1 hunk)
- flow/src/androidMain/resources/scripts/common/evm/call_contract.cdc (1 hunk)
- flow/src/androidMain/resources/scripts/common/evm/evm_run.cdc (1 hunk)
- flow/src/androidMain/resources/scripts/common/staking/get_delegator_info.cdc (1 hunk)
- flow/src/androidMain/resources/scripts/common/token/get_token_balance_storage.cdc (1 hunk)
- flow/src/commonMain/kotlin/org/onflow/flow/AddressRegistry.kt (3 hunks)
- flow/src/commonMain/kotlin/org/onflow/flow/CadenceTarget.kt (1 hunk)
- flow/src/commonMain/kotlin/org/onflow/flow/FlowApi.kt (1 hunk)
- flow/src/commonMain/kotlin/org/onflow/flow/TransactionDSL.kt (1 hunk)
- flow/src/commonMain/kotlin/org/onflow/flow/TransactionResultExtensions.kt (1 hunk)
- flow/src/commonMain/kotlin/org/onflow/flow/apis/TransactionsApi.kt (4 hunks)
- flow/src/commonMain/kotlin/org/onflow/flow/cadence/CadenceQueries.kt (1 hunk)
- flow/src/commonMain/kotlin/org/onflow/flow/evm/EVMManager.kt (6 hunks)
- flow/src/commonMain/kotlin/org/onflow/flow/infrastructure/scripts/ContractAddressRegister.kt (2 hunks)
- flow/src/commonMain/kotlin/org/onflow/flow/models/Address.kt (1 hunk)
- flow/src/commonMain/kotlin/org/onflow/flow/models/Signer.kt (1 hunk)
- flow/src/commonMain/kotlin/org/onflow/flow/websocket/FlowWebSocketClient.kt (1 hunk)
- flow/src/commonMain/resources/scripts/common/addresses.json (1 hunk)
- flow/src/commonMain/resources/scripts/common/child/get_child_account_meta.cdc (1 hunk)
- flow/src/commonMain/resources/scripts/common/child/get_child_addresses.cdc (1 hunk)
- flow/src/commonMain/resources/scripts/common/evm/call_contract.cdc (1 hunk)
- flow/src/commonMain/resources/scripts/common/evm/evm_run.cdc (1 hunk)
- flow/src/commonMain/resources/scripts/common/staking/get_delegator_info.cdc (1 hunk)
- flow/src/commonMain/resources/scripts/common/token/get_token_balance_storage.cdc (1 hunk)
- flow/src/commonTest/kotlin/org/onflow/flow/TransactionResultExtensionsTest.kt (1 hunk)
Actionable Comments (2)
-
flow/src/commonMain/resources/scripts/common/token/get_token_balance_storage.cdc [19-26]
possible bug: "The
seenarray is never populated, causing duplicate type handling to fail." -
flow/src/androidMain/resources/scripts/common/token/get_token_balance_storage.cdc [19-26]
possible bug: "The
seenarray is never populated, causing duplicate type handling to fail."
Skipped Comments (5)
-
flow/src/commonMain/kotlin/org/onflow/flow/TransactionDSL.kt [77-78]
possible issue: "Inconsistent default values for keyIndex between proposer overloads."
-
flow/src/commonMain/kotlin/org/onflow/flow/TransactionDSL.kt [112-117]
enhancement: "Error message could be misleading when key auto-detection fails."
-
flow/src/commonMain/kotlin/org/onflow/flow/evm/EVMManager.kt [91-92]
readability: "Byte to UByte conversion may be unclear for negative byte values."
-
flow/src/commonTest/kotlin/org/onflow/flow/TransactionResultExtensionsTest.kt [45-46]
maintainability: "Unused test variables should be removed."
-
flow/src/commonTest/kotlin/org/onflow/flow/TransactionResultExtensionsTest.kt [65-71]
best practice: "Test relies on external network call and hardcoded transaction ID."
| // Insert a new values if it's the first time we've seen the type | ||
| if !seen.contains(type.identifier) { | ||
| balances.insert(key: type.identifier, vaultRef.balance) | ||
| } else { | ||
| // Otherwise just update the balance of the vault (unlikely we'll see the same type twice in | ||
| // the same account, but we want to cover the case) | ||
| balances[type.identifier] = balances[type.identifier]! + vaultRef.balance | ||
| } |
There was a problem hiding this comment.
The seen array is checked with !seen.contains(type.identifier) but is never updated after inserting a new type. This means the else branch (updating existing balance) will never execute, and duplicate vault types in the same account will overwrite rather than accumulate. Add seen.append(type.identifier) after the first insert.
| // Insert a new values if it's the first time we've seen the type | ||
| if !seen.contains(type.identifier) { | ||
| balances.insert(key: type.identifier, vaultRef.balance) | ||
| } else { | ||
| // Otherwise just update the balance of the vault (unlikely we'll see the same type twice in | ||
| // the same account, but we want to cover the case) | ||
| balances[type.identifier] = balances[type.identifier]! + vaultRef.balance | ||
| } |
There was a problem hiding this comment.
Same issue as the commonMain version: the seen array is never populated after inserting a new type identifier. Add seen.append(type.identifier) after the insert to properly track seen types.
Unit Test Results 24 files 24 suites 2m 5s ⏱️ Results for commit a1d831d. |
Closes: #???
Description
For contributor use:
masterbranchFiles changedin the Github PR explorer