-
Notifications
You must be signed in to change notification settings - Fork 141
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
v3: Change SDK::send's params to take new type IpldBlock #1152
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1152 +/- ##
===========================================
- Coverage 43.10% 25.69% -17.41%
===========================================
Files 128 96 -32
Lines 13110 7767 -5343
===========================================
- Hits 5651 1996 -3655
+ Misses 7459 5771 -1688
|
shared/src/ipld_block.rs
Outdated
// IPLD_RAW => BytesDeserializer::new(self.data.as_slice()) | ||
// .deser() | ||
// .map_err(Into::into), |
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.
Does this not work? (any reason not to just enable it?)
shared/src/ipld_block.rs
Outdated
use fvm_ipld_encoding::DAG_CBOR; | ||
use {serde, serde_ipld_dagcbor}; | ||
|
||
// TODO: Slapped the Serialize derivations on for some actors testing, not clear to me it should stay |
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, they shouldn't. Otherwise, we'll serialize twice.
efeb3f4
to
bfab2e4
Compare
105786f
to
a31c967
Compare
b2ce904
to
ecdb0ec
Compare
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.
this looks useful.
cf4594e
to
8dcfe70
Compare
@@ -135,7 +139,10 @@ fn invoke_method(blk: u32, method: u64) -> u32 { | |||
let output = sdk::send::send( | |||
&Address::new_id(sdk::message::receiver()), | |||
4, | |||
RawBytes::new("input".into()), | |||
Some(IpldBlock { | |||
codec: DAG_CBOR, |
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: now that we can, consider using DAG_RAW? (if it works)
8dcfe70
to
f059465
Compare
IpldBlock supports multiple codecs, including IPLD_RAW. Serializing byte vectors will correctly serialize anything that serializes to "raw bytes". However, it _won't_ serialize "byte lists", so `Vec<u8>` and `[u8]` won't work. But that shouldn't be an issue in practice. Users _should_ serialize to/from `ByteBuf`.
f059465
to
a8f0d84
Compare
Towards #987, but doesn't close it.
Introduces a new IpldBlock type that can support various codecs (currently DAG_CBOR and IPLD_RAW), and switches the SDK::send method to use
Option<IpldBlock>
for params.