-
Notifications
You must be signed in to change notification settings - Fork 1
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 contracts dependency to latest dev #101
Conversation
📝 WalkthroughWalkthroughThe pull request updates the code to transition from using the Changes
Possibly related PRs
Suggested reviewers
Poem
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 (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
go.sum
is excluded by!**/*.sum
📒 Files selected for processing (12)
examples/booking/mintnbuy.go
(3 hunks)examples/events/listen.go
(2 hunks)go.mod
(2 hunks)internal/messaging/mint.go
(2 hunks)internal/messaging/mint_v1.go
(1 hunks)internal/messaging/mint_v2.go
(1 hunks)internal/messaging/response_handler.go
(3 hunks)pkg/booking/booking.go
(2 hunks)pkg/cm_accounts/cm_accounts.go
(3 hunks)pkg/cm_accounts/mock_cm_accounts.go
(1 hunks)pkg/events/listener.go
(8 hunks)tests/e2e/blockchain/client.go
(4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Unit Tests
- GitHub Check: E2E Tests
- GitHub Check: Static Analysis
🔇 Additional comments (31)
pkg/booking/booking.go (2)
134-135
: LGTM! Method signature updated to support price and payment token.The addition of
price
andpaymentToken
parameters aligns with the contract updates.
145-145
: LGTM! Implementation correctly forwards new parameters.The updated implementation properly passes the new parameters to the underlying service.
examples/booking/mintnbuy.go (3)
24-24
: LGTM! Updated import to use new bookingtoken package.The import path has been correctly updated to use the new contract package.
83-83
: LGTM! Contract instantiation updated.The contract instantiation has been correctly updated to use the new bookingtoken package.
237-238
: LGTM! BuyBookingToken call updated with required parameters.The method call has been properly updated to include the new price and payment token parameters.
internal/messaging/mint_v1.go (2)
102-108
: LGTM! Added robust error handling for price retrieval.The code now properly validates price and payment token before proceeding with the purchase, improving reliability.
110-110
: LGTM! Updated BuyBookingToken call with required parameters.The method call has been properly updated to include the retrieved price and payment token.
examples/events/listen.go (2)
13-13
: LGTM! Updated import to use new bookingtoken package.The import path has been correctly updated to use the new contract package.
75-75
: LGTM! Updated event type assertions.Type assertions have been properly updated to use the new bookingtoken event types.
Also applies to: 83-83
pkg/cm_accounts/cm_accounts.go (2)
77-78
: LGTM! The new parameters enhance the method signature.The addition of
price
andpaymentToken
parameters to theBuyBookingToken
method provides better control over the token purchase process.
321-322
: LGTM! The contract call is properly updated.The new parameters are correctly passed to the underlying contract method.
go.mod (1)
8-8
:❓ Verification inconclusive
Verify the contracts dependency version.
The pseudo-version contains a future date (January 29, 2025). Please ensure this is the correct version and commit hash.
🏁 Script executed:
#!/bin/bash # Description: Verify the contracts dependency version. # Check if the commit exists in the repository gh api repos/chain4travel/camino-messenger-contracts/commits/90f8b12cd935 --jq '.sha'Length of output: 126
Contracts dependency version verified, but please double-check the future timestamp
The dependency in
go.mod
now references commit90f8b12cd935
(full SHA:90f8b12cd935948d386941b309f8c224aecfb7e1
), and execution of the verification script confirms that this commit exists in thechain4travel/camino-messenger-contracts
repository. However, notice that the pseudo-version includes a future date (January 29, 2025). Please verify that this timestamp is intentional and aligns with your dependency management strategy.internal/messaging/mint.go (2)
17-17
: LGTM! The import path is correctly updated.The import path is updated to use the new bookingtoken package, consistent with the dependency changes.
78-78
: LGTM! The type assertion is correctly updated.The type assertion is updated to use the new BookingtokenTokenBought type, consistent with the package changes.
pkg/cm_accounts/mock_cm_accounts.go (3)
49-49
: LGTM! The mock method signature is correctly updated.The BuyBookingToken method signature in the mock matches the interface definition.
51-51
: LGTM! The mock method call is correctly updated.The Call method correctly includes all parameters in the right order.
58-60
: LGTM! The mock recorder is correctly updated.The mock recorder is properly updated to handle the new parameters.
internal/messaging/mint_v2.go (1)
106-114
:❓ Verification inconclusive
LGTM! Proper error handling for price and payment token retrieval.
The changes correctly handle price and payment token retrieval before buying the booking token, with appropriate error handling and logging.
Run the following script to verify the updated method signature:
🏁 Script executed:
#!/bin/bash # Description: Verify the updated BuyBookingToken method signature. # Test: Search for the method signature. Expect: Only occurrences of the new signature. ast-grep --pattern 'BuyBookingToken($ctx, $tokenID, $price, $paymentToken)'Length of output: 77
Action Required: Updated BuyBookingToken Signature Needs Further Verification
The changes in
internal/messaging/mint_v2.go
(lines 106-114) correctly update the call to include the new parameters for retrieving the price and payment token, with proper error handling and logging. However, the automated AST grep script did not produce any output, so we cannot conclusively verify that the new signature is the only occurrence or that no outdated call sites remain.
- Please run a manual check or an additional script (e.g., using
rg "BuyBookingToken\\(" -n .
) to confirm that all calls toBuyBookingToken
now use the updated signatureBuyBookingToken(ctx, tokenID, price, paymentToken)
.- Once verified, confirm that no legacy usages remain in the codebase.
internal/messaging/response_handler.go (3)
23-23
: LGTM! Import path updated correctly.The import path has been updated to use the new bookingtoken package.
74-74
: LGTM! Contract instantiation updated correctly.The booking token contract instantiation has been updated to use the new package's constructor.
99-99
: LGTM! Type declaration updated correctly.The bookingToken field type has been updated to use the new package's type.
tests/e2e/blockchain/client.go (4)
14-14
: LGTM! Import path updated correctly.The import path has been updated to use the new bookingtoken package.
347-347
: LGTM! Contract deployment updated correctly.The booking token contract deployment has been updated to use the new package's constructor.
416-416
: LGTM! ABI parsing updated correctly.The ABI parsing has been updated to use the new package's ABI.
462-462
: LGTM! Contract binding updated correctly.The booking token contract binding has been updated to use the new package's constructor.
pkg/events/listener.go (6)
13-13
: LGTM! Import and type declarations updated correctly.The import path and btContracts map type have been updated to use the new bookingtoken package.
Also applies to: 42-42, 52-52
78-87
: LGTM! Method updated correctly.The getOrCreateBookingToken method has been updated to use the new package's type and constructor.
500-500
: LGTM! Event handling updated correctly.The resubscribeTokenBought method has been updated to use the new package's types for contract and events.
Also applies to: 508-508
540-540
: LGTM! Event listener updated correctly.The listenForTokenBoughtEvents method has been updated to use the new package's event type.
581-581
: LGTM! Event handling updated correctly.The resubscribeTokenReserved method has been updated to use the new package's types for contract and events.
Also applies to: 589-589
621-621
: LGTM! Event listener updated correctly.The listenForTokenReservedEvents method has been updated to use the new package's event type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/release.yml (1)
1-2
: Nitpick: Fix Typo in Workflow Name
The workflow name "Publish Release Artifcats" contains a typo. Consider updating "Artifcats" to "Artifacts" for clarity and professionalism.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.github/workflows/ci.yml
(1 hunks).github/workflows/release.yml
(1 hunks)Dockerfile
(1 hunks)Dockerfile.plugin
(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- Dockerfile.plugin
- Dockerfile
🔇 Additional comments (2)
.github/workflows/release.yml (1)
22-24
: Update Go Version in Release Workflow
The Go version has been updated to~1.23.5
, which aligns with updated dependency specifications across the project. Please verify that this version is fully compatible with your build and release scripts..github/workflows/ci.yml (1)
13-15
: Update CI Environment Variable for Go Version
The environment variablego_version
has been updated to"~1.23.5"
, ensuring consistency across the CI workflow, Docker builds, and the Go module. This change helps maintain a unified build environment.
github.com/chain4travel/camino-messenger-contracts/go/contracts
to latest dev (90f8b12cd935
)Summary by CodeRabbit
New Features
Refactor
Chores