-
Notifications
You must be signed in to change notification settings - Fork 254
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
chore: use near-abi 0.3.0 #954
Conversation
&MethodType::Regular => { | ||
quote! { near_sdk::__private::AbiFunctionKind::Call } |
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.
I think it's worth noting for clarity that until #890 is merged, the ABI will represent self
-less functions as call functions. Meaning clients will think they have to send signed transactions and not simply making view calls. Then again, I don't have any stats on how often these are used or if at all, so it might be a trivial nit.
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.
Yeah, but that is also the current behavior, so doesn't have to do anything with this particular change.
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.
Yep!
assert_eq!(args[1].name, "b".to_string()); | ||
} | ||
AbiParameters::Borsh { .. } => { | ||
assert!(false); |
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.
nit: unreachable!()
?
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.
Well, it is not actually unreachable if the thing we are trying to test happens to have borsh serialization though
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.
Hm, but isn't that the point of the test? Asserting that it is JSON serialized and not borsh? (at least in this case)
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.
Yeah, but unreacheable!
to me is something you know (statically) will never be reached, but can't convince compiler to be the case. This test, on the other hand, depends on some external input (a wasm file) and tests its properties.
This is arguing very subtle semantics and honestly it feels like AbiParameters
should just have json()?
and borsh()?
methods instead of this match/fail pattern.
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.
That's fair, wasn't a strong opinion. I'm not sure if we're at the point where we need those helper methods, so we can proceed as-is. 👍🏽
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.
In that case, still seems like panic!() might be more readable?
Related: near/cargo-near#83