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

rpc-v2/transaction: Generate Invalid events and add tests #3784

Merged
merged 7 commits into from
Apr 9, 2024

Conversation

lexnv
Copy link
Contributor

@lexnv lexnv commented Mar 21, 2024

This PR ensures that the transaction API generates an Invalid events for transaction bytes that fail to decode.

The spec mentioned the Invalid event at the jsonrpc error section, however this spec PR makes things clearer:

While at it have discovered an inconsistency with the generated events. The drop event from the transaction pool was incorrectly mapped to the invalid event.

Added tests for the API stabilize the API soon:

Closes: #3083

cc @paritytech/subxt-team

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@lexnv lexnv added A1-insubstantial Pull request requires no code review (e.g., a sub-repository hash update). R0-silent Changes should not be mentioned in any release notes I5-enhancement An additional feature request. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. labels Mar 21, 2024
@lexnv lexnv self-assigned this Mar 21, 2024
self.client.info()
let mut info = self.client.info();

if let Some((block_hash, block_num)) = self.best_block.lock().take() {
Copy link
Member

Choose a reason for hiding this comment

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

This lock().take() is a little hard read/reason about but since it's only for tests that is fine.

@lexnv lexnv added the T10-tests This PR/Issue is related to tests. label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A1-insubstantial Pull request requires no code review (e.g., a sub-repository hash update). D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. I5-enhancement An additional feature request. R0-silent Changes should not be mentioned in any release notes T10-tests This PR/Issue is related to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RPC-Spec-V2] Add tests for transactionWatch_unstable_submitAndWatch
3 participants