Skip to content

Conversation

@qiweiii
Copy link
Contributor

@qiweiii qiweiii commented Aug 25, 2025

the last 0.6.7 fixes

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes include a beneficial refactoring of footprint calculation logic into the ServiceAccountDetails type and a critical fix in the Write host call to prevent writing data if the account balance is insufficient. However, there is a potential type mismatch issue in the Info host call.

@qiweiii qiweiii marked this pull request as ready for review August 25, 2025 02:44
Comment on lines 443 to +446
} else if value == nil {
state.writeRegister(Registers.Index(raw: 7), HostCallResultCode.NONE.rawValue)
} else {
state.writeRegister(Registers.Index(raw: 7), HostCallResultCode.OK.rawValue)
state.writeRegister(Registers.Index(raw: 7), value!.count)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} else if value == nil {
state.writeRegister(Registers.Index(raw: 7), HostCallResultCode.NONE.rawValue)
} else {
state.writeRegister(Registers.Index(raw: 7), HostCallResultCode.OK.rawValue)
state.writeRegister(Registers.Index(raw: 7), value!.count)
} else if let valuel {
state.writeRegister(Registers.Index(raw: 7), value.count)
} else {
state.writeRegister(Registers.Index(raw: 7), HostCallResultCode.NONE.rawValue)

so we can avoid the force unwrap

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will be included in the next pr

@codecov
Copy link

codecov bot commented Aug 25, 2025

Codecov Report

❌ Patch coverage is 93.84615% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.75%. Comparing base (668d64a) to head (471bd52).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
JAMTests/Tests/JAMTests/w3f/AccumulateTests.swift 50.00% 3 Missing ⚠️
.../Blockchain/VMInvocations/HostCall/HostCalls.swift 95.23% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #358      +/-   ##
==========================================
- Coverage   81.80%   81.75%   -0.06%     
==========================================
  Files         378      378              
  Lines       33237    33221      -16     
==========================================
- Hits        27191    27159      -32     
- Misses       6046     6062      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@qiweiii qiweiii merged commit b662031 into master Aug 25, 2025
5 of 6 checks passed
@qiweiii qiweiii deleted the fix-hostcall branch August 25, 2025 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants