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

Improve dynamic events type sizes API #61

Merged
merged 5 commits into from
Jan 7, 2020
Merged

Improve dynamic events type sizes API #61

merged 5 commits into from
Jan 7, 2020

Conversation

ascjones
Copy link
Contributor

@ascjones ascjones commented Jan 7, 2020

Previously if any primitive type for an Event didn't have its type size registered it would fail. This PR relaxes that constraint, but it will still fail if we receive one of those Events with a missing type size registration. To address this, the API no allows registering of type sizes by the user, so the library does not need to be updated to have all primitive types registered.

New API:

xt.watch()
    .events_decoder(|decoder| {
    decoder.register_type_size::<(u64, u64)>("IdentificationTuple")
})
.submit(balances::transfer::<Runtime>(dest.clone().into(), 10_000))

The refactoring here should make it easier to add back static event decoding (#28)

@ascjones ascjones merged commit b159d0d into master Jan 7, 2020
@ascjones ascjones deleted the aj-dyn-events branch January 7, 2020 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant