-
Notifications
You must be signed in to change notification settings - Fork 336
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
Add stargate msg #706
Add stargate msg #706
Conversation
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 good.
But if those messages don't go through signature verification, how is authorization checked (e.g. the MsgSend sender address)?
path: String, | ||
/// this is the expected protobuf message type (not any), binary encoded | ||
data: Binary, | ||
}, |
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 is analogue to this call in CosmJS, right?
public async queryUnverified(path: string, request: Uint8Array): Promise<Uint8Array> {
const response = await this.tmClient.abciQuery({
path: path,
data: request,
prove: false,
});
if (response.code) {
throw new Error(`Query failed with (${response.code}): ${response.log}`);
}
return response.value;
}
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.
Yes 💯 We can provide a link to that code which may help make it more clear
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.
Good, thanks. Then we can avoid the term "message" here, right? It is just "request data" of any kind.
This code handles redispatching the Since we know who the caller is (the contract returning the message), we can easily enforce that is a valid signer, the same way they handle this in the sdk. (This is done for all the messages, which is why we don't require sender fields on them - or auto-enforced the from_address of the BankMsg::Send) |
I think 8b7bc41 addresses all the comments. |
Any more changes required? I will make another small PR on top of this now. |
8b7bc41
to
09b7880
Compare
Closes #694
Adds the message and the query types under a feature flag. And also add the proper requires export.
Contracts have it off by default and
cargo test --features stargate
passes incosmwasm-std
.This is really just to pass info up to wasmd, and doesn't need test mocks (they would be too hard to build)