-
Notifications
You must be signed in to change notification settings - Fork 20
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
Document SysError::LengthNotEnough
intended usage
#100
Comments
The document is here: Line 8 in d4526dc
|
@XuJiandong that's way too little and way too hidden to call it documentation. I would understand if use ckb_std::error::SysError;
/// Error
#[repr(i8)]
pub enum Error {
IndexOutOfBound = 1,
ItemMissing,
LengthNotEnough,
Encoding,
// Add customized errors here...
MyError,
}
impl From<SysError> for Error {
fn from(err: SysError) -> Self {
use SysError::*;
match err {
IndexOutOfBound => Self::IndexOutOfBound,
ItemMissing => Self::ItemMissing,
LengthNotEnough(_) => Self::LengthNotEnough,
Encoding => Self::Encoding,
Unknown(err_code) => panic!("unexpected sys error {}", err_code),
}
}
} |
Also I would recommend for every low level syscall to document this particular behavior |
The |
Capsule deprecated, really?! As you may know, iCKB just got an internal code review and I'm sure that the reviewers would have told me right away if the Nervos standard library on which iCKB is built on top is deprecated. Also until now no deprecation notice appears on both capsule and ckb-std Readme. While I understand that it's in the process of being switched out (not sure why), it currently doesn't seem deprecated. Additionally, these docs also helps understand better code that is alredy deployed. Love & Peace, Phroi |
This is not correct. The capsule is just a tool and doesn't affect the final on-chain script at all. Capsule doesn't include |
Wow, what a relief!! Then my issue still remains with Please, could you document on the low level syscalls how the returned error should be handled? This is definitely not enough documentation for a new developer who is just trying out Love & Peace, Phroi |
Developers can view SysError directly. Feel free to submit a PR if you believe anything should be added. |
Not clear there and, to be honest, it's not even clear on the syscalls RFC... Adding to the things to do: creating two PR. I'd kindly ask you to leave this issue open until my PR. |
Following @XuJiandong advice:
I switched iCKB
load_cell_data
calls from thehighlevel
tosyscall
. At that point all the contracts stopped validating, completely.After too much digging I understood the
SysError::LengthNotEnough
lifecycle in correlation to syscalls fromload_data implementation
. I did not found any other documentation except that private function, not even in the relative RFC.Please, could you update the syscall documentation with this crucial information about
SysError::LengthNotEnough
?Keep up the great work 💪
Phroi
The text was updated successfully, but these errors were encountered: