Skip to content
This repository was archived by the owner on Aug 27, 2024. It is now read-only.

Conversation

@wheresaddie
Copy link
Contributor

updated to 0x0c

updated to 0x0c
@danforbes
Copy link
Contributor

Apparently this is the actual change to the transaction encoding (?) that caused the version bump paritytech/substrate#6969 I'm not sure if this change has been incorporated into our docs.

@wheresaddie
Copy link
Contributor Author

good to know. In that case might run this by @folsen or @gnunicorn ..?

@gnunicorn
Copy link
Contributor

@thiolliere should be able to say.

@gui1117
Copy link
Contributor

gui1117 commented Oct 6, 2020

below in the doc is explained each field of module metadata: name, storage, error, ... but not index.

An explanation is that index is:

index comes from how pallet is defined in construct_runtime. For example:

construct_runtime!(
...
{
Pallet: my_pallet::{...}, // index is implicitly 0
MySecondPallet: my_second_pallet::{..} = 2, // index is explicitly 2
MyOtherPallet: my_other_pallet::{..}, // index is implicitly 3 (same rules as rust fieldless enum 
}
)

I'm not sure it is interesting to go into such details, just saying it is the index assigned in construct_runtime seems enough.

About the change to the transaction encoding, this document doesn't explain it here, but maybe another document covers it ?

The encoding change is this: before:

construct_runtime!(
...
{
Pallet: my_pallet::{Event}, // the variant for Pallet event in the runtime event is at index 0
MySecondPallet: my_second_pallet::{Call}, // the variant for MySecondPallet call in the runtime call is at index 0
MyOtherPallet: my_other_pallet::{Call, Event}, // the variant for MyOtherPallet call in the runtime call is at index 1 and event at index 1
}
)

and now

construct_runtime!(
...
{
Pallet: my_pallet::{Event}, // the variant for Pallet event in the runtime event is at index 0
MySecondPallet: my_second_pallet::{Call}, // the variant for MySecondPallet call in the runtime call is at index 1
MyOtherPallet: my_other_pallet::{Call, Event}, // the variant for MyOtherPallet call in the runtime call is at index 2 and event at index 2
}
)

i.e. for Event, Call and Origin the index for the corresponding variant is the index of the pallet.

@danforbes
Copy link
Contributor

Is this still relevant or was it superseded by #718?

@danforbes danforbes deleted the wheresaddie-patch-v12 branch December 15, 2020 02:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants