-
Notifications
You must be signed in to change notification settings - Fork 0
fix hostcalls #358
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
fix hostcalls #358
Conversation
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.
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.
| } 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) |
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.
| } 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
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.
will be included in the next pr
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
the last 0.6.7 fixes