-
Notifications
You must be signed in to change notification settings - Fork 248
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
scale-type-resolver
integration
#1460
scale-type-resolver
integration
#1460
Conversation
@@ -65,10 +65,6 @@ pub struct Payload<CallData> { | |||
validation_hash: Option<[u8; 32]>, | |||
} | |||
|
|||
/// A boxed transaction payload. | |||
// Dev Note: Arc used to enable easy cloning (given that we can't have dyn Clone). | |||
pub type BoxedPayload = Payload<Arc<dyn EncodeAsFields + Send + Sync + 'static>>; |
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.
Note: This was removed, because EncodeAsFields
is not object safe anymore and in the public element room for subxt noone seemed to care about it not being supported anymore.
) -> Result<Self::Value<'scale, 'info>, Self::Error> { | ||
use scale_decode::error::{Error, ErrorKind}; | ||
|
||
if value.path().ident().as_deref() != Some("WrapperKeepOpaque") { |
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: can we add a TODO here like:
// TODO: When `scale-type-resolver` provides struct names, check that this struct name is `WrapperKeepOpaque`
Or alterantely link an issue that says the same :)
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.
Looks great to me, good job getting this done!
subxt/src/utils/wrapper_opaque.rs
Outdated
let scale_info::TypeDef::Composite(_) = &ty.type_def else { | ||
return Err(Error::new(ErrorKind::WrongShape { | ||
let visitor = visitor::new(out, |_, _| { | ||
// Check that the target shape lines up: any other shape but composite it wrong. |
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.
// Check that the target shape lines up: any other shape but composite it wrong. | |
// Check that the target shape lines up: any other shape but the composite is wrong. |
This PR updates subxt to the latest versions of
scale-value
,scale-decode
,scale-encode
andscale-typgen
which rely on thescale-type-resolver
crate James wrote.