-
Notifications
You must be signed in to change notification settings - Fork 50
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
Patch feat/expose expt rpc apis #301
Conversation
…expose-expt-rpc-apis
Reviews addressed |
@frol This is ready to be reviewed. |
…ev/workspaces-rs into patch-feat/expose-expt-rpc-apis
examples/src/changes.rs
Outdated
let outcome = contract | ||
_ = contract | ||
.call("set_status") | ||
.args_json(json!({ | ||
"message": "hello_world", | ||
})) | ||
.transact() | ||
.await?; |
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.
ideally should be using the result of the transaction. Best to add an into_result()?
at the end to show best practices
examples/src/changes_in_block.rs
Outdated
let outcome = contract | ||
_ = contract | ||
.call("set_status") | ||
.args_json(json!({ | ||
"message": "hello_world", | ||
})) | ||
.transact() | ||
.await?; |
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.
same here
workspaces/src/worker/impls.rs
Outdated
) -> Result<ProtocolConfigView> { | ||
self.client().protocol_config(block_reference).await | ||
} | ||
pub async fn receipt(&self, ids: &[CryptoHash]) -> Result<ReceiptView> { |
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.
why is there a list of IDs passed when only the last one gets used via ids.last()
?
examples/src/changes.rs
Outdated
StateChangesRequestView::ContractCodeChanges { | ||
account_ids: vec![contract.id().clone()], | ||
} | ||
let state_changes = StateChangesRequestView::ContractCodeChanges { |
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 don't like how we're utilizing *View
structs to commit requests into the network. How about we create our own non-view ones, and that way we don't expose nearcore related dependencies too
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.
Checking on that
…ev/workspaces-rs into patch-feat/expose-expt-rpc-apis
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.
Everything else besides the two point I had looks good to me
workspaces/src/worker/impls.rs
Outdated
block_reference: BlockReference, | ||
) -> Result<RpcStateChangesInBlockByTypeResponse> { | ||
self.client().changes_in_block(block_reference).await | ||
pub fn changes(&self, account_ids: Vec<AccountId>) -> Query<'_, StateChanges> { |
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.
The inputs to this should just be a slice instead of a Vec
as to make it more ergonomic for users to make use of
pub fn changes(&self, account_ids: Vec<AccountId>) -> Query<'_, StateChanges> { | |
pub fn changes(&self, account_ids: &[AccountId]) -> Query<'_, StateChanges> { |
Addressing code reviews for #285