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

Add docs to ConvertTransaction and NoTransactionConverter #977

Merged
merged 3 commits into from
Aug 1, 2023

Conversation

sorpaas
Copy link
Member

@sorpaas sorpaas commented Jan 20, 2023

fixes #166

It's a legacy type (as a last resort for transaction conversion) that is almost never used. In the future we should probably group them into a Fallback type and assign it a default type value, so that people don't need to care about it.

pub trait ConvertTransaction<E> {
fn convert_transaction(&self, transaction: ethereum::TransactionV2) -> E;
}

/// No fallback transaction converter is available.
// `NoTransactionConverter` is a non-instantiable type (an enum with no variants),
// so we are guaranteed at compile time that `NoTransactionConverter` can never be instantiated.
pub enum NoTransactionConverter {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we replace the TransactionConverter with NoTransactionConverter in the template node runtime?

The runtime has implemented the ConvertTransactionRuntimeApi, so there is no need for a fallback function there.

@sorpaas sorpaas merged commit c020c05 into master Aug 1, 2023
@sorpaas sorpaas deleted the sp-docs-transaction-convert branch August 1, 2023 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing docs on RPC primitives
2 participants