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 method: fn send_xt<C: Encode>(xt: UncheckedExtrinsic<C>, xt_status: XtStatus) #90

Closed
clangenb opened this issue May 21, 2020 · 2 comments · Fixed by #421
Closed
Assignees
Labels
F7-enhancement Enhances an already existing functionality Q0-trivial

Comments

@clangenb
Copy link
Collaborator

We always hex encode extrinsics on our own before sending them.

we could use sp_core::Bytes type as parameter type to the json requests = Struct Bytes(Vec<u8>), which has custom serialization that prepends 0x. Then we can simply pass the encoded value of the extrinsic

@brenzi brenzi added the F7-enhancement Enhances an already existing functionality label May 21, 2020
@clangenb
Copy link
Collaborator Author

clangenb commented Nov 13, 2021

Actually, I think we should just add a method (don't remove the current one accepting a string):

fn send_xt<C: Encode>(xt: UncheckedExtrinsic<C>, xt_status: XtStatus)

This will remove some boilerplate code on the caller site.

Then we could also run some validation against the metadata before sending.

@clangenb clangenb changed the title use Bytes type in calls that send transactions add method: fn send_xt<C: Encode>(xt: UncheckedExtrinsic<C>, xt_status: XtStatus) Nov 13, 2021
@haerdib haerdib self-assigned this Jan 5, 2023
@haerdib
Copy link
Contributor

haerdib commented Jan 5, 2023

I think the validation should happen during the call creation, not the sending. See #416

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F7-enhancement Enhances an already existing functionality Q0-trivial
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants