Skip to content
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

feat: SDK::send returns ExitCode and Option<IpldBlock> #177

Merged
merged 4 commits into from
Jan 6, 2023

Conversation

arajasek
Copy link
Contributor

@coveralls
Copy link

coveralls commented Dec 23, 2022

Coverage Status

Coverage: 83.047% (-0.08%) from 83.126% when pulling 1545f77 on asr/ipld-block-master into ba690e9 on main.

@@ -132,16 +147,16 @@ impl<T: RecipientData> ReceiverHook<T> {
&TokenAmount::zero(),
)?;

match receipt.exit_code {
match ret.0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I think we want to name the return struct. This is going to get confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done :)

@arajasek arajasek force-pushed the asr/ipld-block-master branch 2 times, most recently from 2ffd727 to 882fb5c Compare January 4, 2023 17:00
Copy link
Member

@anorth anorth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good after deps are clean

@@ -118,7 +118,7 @@ pub struct MintReturn {
pub balance: TokenAmount,
/// The new total supply.
pub supply: TokenAmount,
/// (Optional) data returned from receiver hook
/// (Optional) CBOR-encoded data returned from receiver hook
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think anything here forces this to be CBOR, and this comment is likely to rot. cc @Stebalien

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably just switch this over to Option<IpldBlock> (or actually check the codec).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're both right -- I'm gonna open an issue to make this change. It shouldn't be too hard to do, but I don't wanna increase the scope of this PR.

@anorth I will revert the change to the comment, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -51,6 +50,21 @@ impl From<&MessagingError> for ExitCode {
}
}

/// Matches the SDK's Response type
/// We duplicate the type here, because this trait must be implemented
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trait?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm referring to the Messaging trait below -- I'll clarify.

@@ -118,7 +118,7 @@ pub struct MintReturn {
pub balance: TokenAmount,
/// The new total supply.
pub supply: TokenAmount,
/// (Optional) data returned from receiver hook
/// (Optional) CBOR-encoded data returned from receiver hook
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably just switch this over to Option<IpldBlock> (or actually check the codec).

@arajasek arajasek merged commit 532dc16 into main Jan 6, 2023
@arajasek arajasek deleted the asr/ipld-block-master branch January 6, 2023 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants