Bump to latest Substrate metadata (#5770)

This commit is contained in:
Jaco
2023-12-11 10:25:48 +02:00
committed by GitHub
parent 53f9abe4e2
commit db1a699c0a
20 changed files with 10457 additions and 7210 deletions
+20 -9
View File
@@ -15,22 +15,33 @@ const metadata = new Metadata(registry, metadataStatic);
registry.setMetadata(metadata);
describe('Call', (): void => {
// balances.forceSetBalance(0x, 0)
const FSBU8 = new Uint8Array([
// index
6, 8,
// id lookup
0,
// public
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
// value
0
]);
it('handles decoding correctly (bare)', (): void => {
expect(
new Call(registry, {
args: ['0x0000000000000000000000000000000000000000000000000000000000000000', 0, 0],
callIndex: [6, 1] // balances.setBalance
args: ['0x0000000000000000000000000000000000000000000000000000000000000000', 0],
callIndex: [6, 8]
}).toU8a()
).toEqual(
new Uint8Array([6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
);
).toEqual(FSBU8);
});
it('handles creation from a hex value properly', (): void => {
expect(
new Call(registry, '0x06010000000000000000000000000000000000000000000000000000000000000000').toU8a()
).toEqual(
new Uint8Array([6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
); // balances.setBalance
new Call(registry, '0x0608000000000000000000000000000000000000000000000000000000000000000000').toU8a()
).toEqual(FSBU8);
});
});
@@ -26,12 +26,17 @@ describe('decorateEvents', (): void => {
expect(
events['staking']['Rewarded'].meta.toJSON()
).toEqual({
args: ['AccountId32', 'u128'],
args: [
'AccountId32',
'{"_enum":{"Staked":"Null","Stash":"Null","Controller":"Null","Account":"AccountId32","None":"Null"}}',
'u128'
],
docs: [
'The nominator has been rewarded by this amount.'
'The nominator has been rewarded by this amount to this destination.'
],
fields: [
{ docs: [], name: 'stash', type: 0, typeName: 'T::AccountId' },
{ docs: [], name: 'dest', type: 50, typeName: 'RewardDestination<T::AccountId>' },
{ docs: [], name: 'amount', type: 6, typeName: 'BalanceOf<T>' }
],
index: 1,