fix: increased server timeout#280
Conversation
…tstrap Switch from CIP56TransferFactory (atomic, local-only) to DA's AllocationFactory from utility_registry_app_v0. This factory creates TransferOffer contracts on TransferFactory_Transfer, matching devnet behaviour where the receiver must exercise TransferInstruction_Accept to complete the transfer. Also bootstraps TransferRule and InstrumentConfiguration (with empty holderRequirements) which are required as choiceContextData when the receiver accepts the transfer offer. Closes #258
There was a problem hiding this comment.
Code Review
This pull request increases server and RPC timeouts to 60 seconds across several configuration files. It also includes a significant refactor of the registry API integration to align with the Splice token-standard spec, updating request/response structures and ensuring consistent timestamp handling between registry calls and on-ledger transactions. Feedback highlights that the PR description should be updated to reflect this refactor, suggests defining a named constant for the ledger time skew offset, and recommends a performance optimization for JSON null checks to avoid unnecessary heap allocations.
I am having trouble creating individual review comments. Click here to see my feedback.
pkg/cantonsdk/token/client.go (911)
The pull request title and description only mention increasing server timeouts, but the changes include a significant refactor of the registry API integration (aligning with the Splice token-standard spec). This mismatch makes the commit history misleading. Please update the PR title and description to accurately reflect the scope of these changes, including the breaking changes to the registry request/response structures.
pkg/cantonsdk/token/client.go (890)
The backdating offset of -5 * time.Second is used here and in buildTransferCommand (line 647) to account for ledger time skew. This magic number should be defined as a named constant at the package level to ensure consistency and improve maintainability, especially since it directly affects command acceptance on the Canton ledger.
pkg/cantonsdk/token/registry_client.go (168)
Converting json.RawMessage to a string for comparison with jsonNull ("null") causes an unnecessary heap allocation. It is more efficient to use bytes.Equal for this check.
if len(wire.ChoiceContext) > 0 && !bytes.Equal(wire.ChoiceContext, []byte(jsonNull)) {
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #280 +/- ##
=======================================
Coverage ? 30.61%
=======================================
Files ? 130
Lines ? 10056
Branches ? 0
=======================================
Hits ? 3079
Misses ? 6710
Partials ? 267
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
No description provided.