fix(core): fix upgrade with enum keys - #3289
Conversation
|
Caution Review failedFailed to post review comments. Configuration used: .coderabbit.yaml ⛔ Files ignored due to path filters (6)
📒 Files selected for processing (26)
🧰 Additional context used🧠 Learnings (12)crates/dojo/core-cairo-test/Scarb.toml (2)Learnt from: glihm Learnt from: glihm bin/sozo/src/commands/execute.rs (1)Learnt from: glihm Examples:
.github/workflows/test.yml (2)Learnt from: steebchen Learnt from: steebchen crates/dojo/core-cairo-test/src/tests/model/model.cairo (2)Learnt from: glihm Learnt from: glihm bin/sozo/src/commands/auth.rs (1)Learnt from: glihm Examples:
examples/spawn-and-move/dojo_dev.toml (1)Learnt from: glihm crates/dojo/utils/src/tx/mod.rs (3)Learnt from: glihm Learnt from: glihm Learnt from: glihm Examples:
bin/sozo/src/commands/options/transaction.rs (3)Learnt from: glihm Examples:
Learnt from: glihm Learnt from: glihm crates/dojo/core-cairo-test/src/tests/world/model.cairo (2)Learnt from: glihm Learnt from: glihm examples/simple/manifest_sepolia.json (1)Learnt from: glihm crates/dojo/core-cairo-test/src/tests/meta/introspect.cairo (2)Learnt from: glihm Learnt from: glihm Examples:
crates/dojo/core-cairo-test/src/tests/helpers/model.cairo (2)Learnt from: glihm Learnt from: glihm 🔇 Additional comments (39)
WalkthroughOhayo sensei! This update introduces a Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant Invoker
participant Network
User->>CLI: Initiate multicall with max_calls option
CLI->>Invoker: multicall()
alt max_calls is set
Invoker->>Invoker: Chunk calls by max_calls
loop For each chunk
Invoker->>Network: Send transaction for chunk
Network-->>Invoker: Return TransactionResult
end
Invoker-->>CLI: Return Vec<TransactionResult>
else No max_calls
Invoker->>Network: Send all calls in one transaction
Network-->>Invoker: Return TransactionResult
Invoker-->>CLI: Return Vec<TransactionResult> (single element)
end
CLI->>User: Print each TransactionResult
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Note ⚡️ Unit Test Generation - BetaCodeRabbit's unit test generation is now available in Beta! Automatically generate comprehensive unit tests for your code changes, ensuring better test coverage and catching edge cases you might miss. Our AI analyzes your code structure and creates tests that follow best practices and your project's testing patterns. Learn more here, or just try it under ✨ Finishing Touches. ✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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
Documentation and Community
|
glihm
left a comment
There was a problem hiding this comment.
Thank you for the double PR to ensure we can release that on 1.6.0 stable release before proc macros.
I've tested with pistols use case too, and worked as intended. 👍
Description
In the way we check if a model can be upgraded, some cases for
keymembers are not well managed.Here are the
keymember upgrade rules that are checked according to thekeymember type:Primitive: same than for avaluemember, the new type must have the same or a bigger size than the old type (u8->u16),Struct: new members are NOT allowed. Existing member types must follow thekeymember upgrade rules,Enum: new variants are allowed. Existing variant data types must follow thekeymember upgrade rules,Tuple: tuple items must follow thekeymember upgrade rules and the tuple size must remain the same,Array: the array item type must follow thekeymember upgrade rules,ByteArray: always allowed.Tests
Added to documentation?
Checklist
scripts/rust_fmt.sh,scripts/cairo_fmt.sh)scripts/clippy.sh,scripts/docs.sh)Summary by CodeRabbit
New Features
Bug Fixes
Tests
Refactor
Chores