docs: Fullnode Typings [13] - Nano methods#1015
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1015 +/- ##
==========================================
+ Coverage 87.38% 87.39% +0.01%
==========================================
Files 114 114
Lines 8790 8791 +1
Branches 1983 1984 +1
==========================================
+ Hits 7681 7683 +2
+ Misses 1081 1080 -1
Partials 28 28 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
# Conflicts: # src/new/wallet.ts
📝 WalkthroughWalkthroughThis PR enhances type safety for Nano contract and on-chain blueprint operations by replacing generic Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/new/wallet.ts`:
- Around line 3441-3443: In getNanoHeaderSeqnum, guard the result of
this.storage.getAddressInfo(address) and its seqnum before incrementing: check
if addressInfo is null/undefined and treat a missing seqnum as 0 (or explicitly
handle the null case by throwing if that’s preferred), then compute and return
(seqnum || 0) + 1; update references to addressInfo and seqnum so you never read
.seqnum from a null value (use a local const seqnum = addressInfo?.seqnum ?? 0
and return seqnum + 1).
- Around line 3076-3081: Add runtime checks at the start of
createNanoContractTransaction and createNanoContractCreateTokenTransaction to
validate that CreateNanoTxData.blueprintId, ncId, and args are present (not
undefined or null) and throw a descriptive error (e.g., "blueprintId is required
for nano contract transaction") if any are missing; then remove the non-null
assertions in the builder chain (replace data.blueprintId!, data.ncId!,
data.args! with data.blueprintId, data.ncId, data.args) so the code uses the
validated values and fails fast with a clear message.
Depends on #1013 for the test coverage reduction
Acceptance Criteria
Security Checklist
Summary by CodeRabbit