Latest metadata (srml/utility) (#1448)
* Latest metadata (srml/utility) * Move types to utility * Add sample Kusama test * Wrap in describeE2E * Linting * DispatchResult only in utility srml * Fixup some tests (types at least) * api-metadata tests
This commit is contained in:
@@ -32,7 +32,7 @@ describe('fromMetadata', (): void => {
|
||||
// version, no signature
|
||||
1,
|
||||
// index
|
||||
2, 0,
|
||||
3, 0,
|
||||
// values, Compact<Moment>
|
||||
116
|
||||
])
|
||||
|
||||
@@ -35,10 +35,10 @@ describe('extrinsics', (): void => {
|
||||
'2502' + // length
|
||||
'81' + // signed flag
|
||||
'ffd172a74cda4c865912c32ba0a80a57ae69abae410e5ccb59dee84e2f4432db4f' + // who
|
||||
'fa4c192f6960a3bcdbdee5bcd9c26a3f971b131081912abcc31eab6a0b7589ab' + // sig1
|
||||
'7f99b81a01738cb5e2a911a19d5daa5c0b654d4b8dbc521a6b29090c6d205903' + // sig2
|
||||
'5322aca55349f72dbfa57f3e2484f3457c960fbd7f540fcf70433180c70f8af5' + // sig1
|
||||
'0f3c8dd7a7fbc8e23cfd9e3bc87f31008598e2be3feef512ed942f0240e1a908' + // sig2
|
||||
'0000' + // nonce & era
|
||||
'0500' + // balances.transfer
|
||||
'0600' + // balances.transfer
|
||||
'ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9' + // to
|
||||
'e56c' // value
|
||||
);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
// Copyright 2017-2019 @polkadot/api authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import WsProvider from '@polkadot/rpc-provider/ws';
|
||||
import ApiPromise from '../../../src/promise';
|
||||
import { describeE2E } from '../../util';
|
||||
|
||||
describeE2E({
|
||||
only: ['remote-polkadot-kusama']
|
||||
})('Promise e2e kusama queries', (wsUrl: string): void => {
|
||||
let api: ApiPromise;
|
||||
|
||||
beforeEach(async (done): Promise<void> => {
|
||||
api = await ApiPromise.create({ provider: new WsProvider(wsUrl) });
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('retrieves the list of validators', async (): Promise<void> => {
|
||||
const intentions = await api.query.staking.validators();
|
||||
|
||||
console.error(JSON.parse(JSON.stringify(intentions)));
|
||||
});
|
||||
});
|
||||
@@ -10,6 +10,7 @@ const WS_ENDPOINTS = {
|
||||
'docker-polkadot-master': 'ws://127.0.0.1:9948/',
|
||||
'docker-polkadot-alexander': 'ws://127.0.0.1:9949/',
|
||||
'remote-polkadot-alexander': 'wss://poc3-rpc.polkadot.io/',
|
||||
'remote-polkadot-kusama': 'wss://kusama-rpc.polkadot.io/',
|
||||
'remote-substrate-1.0': 'wss://substrate-rpc.parity.io/'
|
||||
};
|
||||
|
||||
|
||||
@@ -277,6 +277,18 @@
|
||||
"documentation": [
|
||||
" Kill some items from storage."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "kill_prefix",
|
||||
"args": [
|
||||
{
|
||||
"name": "prefix",
|
||||
"type": "Key"
|
||||
}
|
||||
],
|
||||
"documentation": [
|
||||
" Kill all storage items with a key that starts with the given prefix."
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
@@ -299,6 +311,34 @@
|
||||
],
|
||||
"constants": []
|
||||
},
|
||||
{
|
||||
"name": "Utility",
|
||||
"storage": null,
|
||||
"calls": [
|
||||
{
|
||||
"name": "batch",
|
||||
"args": [
|
||||
{
|
||||
"name": "calls",
|
||||
"type": "Vec<Call>"
|
||||
}
|
||||
],
|
||||
"documentation": [
|
||||
" Send a batch of dispatch calls (only root)."
|
||||
]
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"name": "BatchExecuted",
|
||||
"args": [
|
||||
"Vec<DispatchResult>"
|
||||
],
|
||||
"documentation": []
|
||||
}
|
||||
],
|
||||
"constants": []
|
||||
},
|
||||
{
|
||||
"name": "Babe",
|
||||
"storage": {
|
||||
@@ -2947,7 +2987,7 @@
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"type": "BalanceOf"
|
||||
"type": "Compact<BalanceOf>"
|
||||
}
|
||||
],
|
||||
"documentation": [
|
||||
@@ -2994,7 +3034,7 @@
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"type": "BalanceOf"
|
||||
"type": "Compact<BalanceOf>"
|
||||
}
|
||||
],
|
||||
"documentation": [
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -22,6 +22,7 @@ import { FullIdentification, IdentificationTuple, Keys, SessionIndex, SessionKey
|
||||
import { EraIndex, EraPoints, EraRewards, Exposure, Forcing, IndividualExposure, MomentOf, Points, RewardDestination, SlashJournalEntry, StakingLedger, UnlockChunk, ValidatorPrefs, ValidatorPrefs0to145 } from '@polkadot/types/interfaces/staking';
|
||||
import { DigestOf, DispatchError, Event, EventId, EventIndex, EventRecord, EventRecord0to76, Key, Phase } from '@polkadot/types/interfaces/system';
|
||||
import { TreasuryProposal } from '@polkadot/types/interfaces/treasury';
|
||||
import { DispatchResult, DispatchResultOf } from '@polkadot/types/interfaces/utility';
|
||||
import { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations';
|
||||
import { EcdsaSignature, EthereumAddress } from '@polkadot/types/interfaces/claims';
|
||||
import { AttestedCandidate, AuctionIndex, BalanceUpload, Bidder, CandidateReceipt, CollatorSignature, EgressQueueRoot, HeadData, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, LeasePeriod, LeasePeriodOf, NewBidder, ParaId, ParaIdOf, ParachainDispatchOrigin, SlotRange, SubId, UpwardMessage, ValidatorIndex, ValidityAttestation, ValidityVote, WinningData, WinningDataEntry } from '@polkadot/types/interfaces/parachains';
|
||||
@@ -634,6 +635,12 @@ export interface InterfaceRegistry {
|
||||
TreasuryProposal: TreasuryProposal;
|
||||
'Option<TreasuryProposal>': Option<TreasuryProposal>;
|
||||
'Vec<TreasuryProposal>': Vec<TreasuryProposal>;
|
||||
DispatchResult: DispatchResult;
|
||||
'Option<DispatchResult>': Option<DispatchResult>;
|
||||
'Vec<DispatchResult>': Vec<DispatchResult>;
|
||||
DispatchResultOf: DispatchResultOf;
|
||||
'Option<DispatchResultOf>': Option<DispatchResultOf>;
|
||||
'Vec<DispatchResultOf>': Vec<DispatchResultOf>;
|
||||
BlockAttestations: BlockAttestations;
|
||||
'Option<BlockAttestations>': Option<BlockAttestations>;
|
||||
'Vec<BlockAttestations>': Vec<BlockAttestations>;
|
||||
|
||||
@@ -24,6 +24,7 @@ export { default as session } from './session/definitions';
|
||||
export { default as staking } from './staking/definitions';
|
||||
export { default as system } from './system/definitions';
|
||||
export { default as treasury } from './treasury/definitions';
|
||||
export { default as utility } from './utility/definitions';
|
||||
|
||||
// polkadot-specific types
|
||||
export { default as attestations } from './attestations/definitions';
|
||||
|
||||
@@ -51,7 +51,7 @@ describe('SignedBlock', (): void => {
|
||||
describe('eras', (): void => {
|
||||
it('can decode immortals', (): void => {
|
||||
const s = createType('SignedBlock', immortalTxs.result);
|
||||
const immortalTx = s.block.extrinsics[2];
|
||||
const immortalTx = s.block.extrinsics[0];
|
||||
|
||||
expect(immortalTx.method.methodName).toEqual('transfer');
|
||||
expect(immortalTx.method.sectionName).toEqual('balances');
|
||||
@@ -59,7 +59,7 @@ describe('SignedBlock', (): void => {
|
||||
|
||||
it('can decode mortals', (): void => {
|
||||
const s = createType('SignedBlock', mortalTxs.result);
|
||||
const mortalTx = s.block.extrinsics[2];
|
||||
const mortalTx = s.block.extrinsics[0];
|
||||
|
||||
expect(mortalTx.method.methodName).toEqual('transfer');
|
||||
expect(mortalTx.method.sectionName).toEqual('balances');
|
||||
|
||||
@@ -20,6 +20,7 @@ export * from './session/types';
|
||||
export * from './staking/types';
|
||||
export * from './system/types';
|
||||
export * from './treasury/types';
|
||||
export * from './utility/types';
|
||||
export * from './attestations/types';
|
||||
export * from './claims/types';
|
||||
export * from './parachains/types';
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// Copyright 2017-2019 @polkadot/types authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
export default {
|
||||
types: {
|
||||
// Not 100% on this one this is defined as - result::Result<(), Error>
|
||||
// we would probably need a result codec type (instead of approximating it)
|
||||
DispatchResult: {
|
||||
_enum: {
|
||||
Ok: 'Null',
|
||||
Error: 'Text'
|
||||
}
|
||||
},
|
||||
DispatchResultOf: 'DispatchResult'
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
// Auto-generated via `yarn build:interfaces`, do not edit
|
||||
/* eslint-disable @typescript-eslint/no-empty-interface */
|
||||
|
||||
export * from './types';
|
||||
@@ -0,0 +1,18 @@
|
||||
// Auto-generated via `yarn build:interfaces`, do not edit
|
||||
/* eslint-disable @typescript-eslint/no-empty-interface */
|
||||
|
||||
import { Enum } from '@polkadot/types/codec';
|
||||
import { Text } from '@polkadot/types/primitive';
|
||||
|
||||
/** Enum */
|
||||
export interface DispatchResult extends Enum {
|
||||
/** 0:: Ok */
|
||||
readonly isOk: boolean;
|
||||
/** 1:: Error(Text) */
|
||||
readonly isError: boolean;
|
||||
/** Text */
|
||||
readonly asError: Text;
|
||||
}
|
||||
|
||||
/** DispatchResult */
|
||||
export interface DispatchResultOf extends DispatchResult {}
|
||||
@@ -1 +1,23 @@
|
||||
{"jsonrpc":"2.0","result":{"block":{"extrinsics":["0x20010100038431055d","0x140109007502"],"header":{"digest":{"logs":["0x066175726120614c411700000000","0x05617572610101c4dd7f7d2a7521a91b821c44d0b8a628e4d804c0428b20a8e281aeaff575001cd55f4540db0fa78e5521b330d1a7ef9e8b922ca723097b4ab83e59a13fb44f0c"]},"extrinsicsRoot":"0x907510396823ad5299bd8b7e3d922e182f117032a0653a85f9ad3cb58044a086","number":"0x9e","parentHash":"0xf17a9ca2e515a68c6e1b0315c5182d237580507c60487f5a6b75c703aa3e84ab","stateRoot":"0x5a4cfd95c29f8db93119a11e012c3905767cc4b7e3a3a2f6bc72879e51a47cd4"}},"justification":null},"id":86}
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"result": {
|
||||
"block": {
|
||||
"extrinsics": [
|
||||
],
|
||||
"header": {
|
||||
"digest": {
|
||||
"logs": [
|
||||
"0x066175726120614c411700000000",
|
||||
"0x05617572610101c4dd7f7d2a7521a91b821c44d0b8a628e4d804c0428b20a8e281aeaff575001cd55f4540db0fa78e5521b330d1a7ef9e8b922ca723097b4ab83e59a13fb44f0c"
|
||||
]
|
||||
},
|
||||
"extrinsicsRoot": "0x907510396823ad5299bd8b7e3d922e182f117032a0653a85f9ad3cb58044a086",
|
||||
"number": "0x9e",
|
||||
"parentHash": "0xf17a9ca2e515a68c6e1b0315c5182d237580507c60487f5a6b75c703aa3e84ab",
|
||||
"stateRoot": "0x5a4cfd95c29f8db93119a11e012c3905767cc4b7e3a3a2f6bc72879e51a47cd4"
|
||||
}
|
||||
},
|
||||
"justification": null
|
||||
},
|
||||
"id": 86
|
||||
}
|
||||
|
||||
@@ -1 +1,24 @@
|
||||
{"jsonrpc":"2.0","result":{"block":{"extrinsics":["0x20010100033822245d","0x14010a002534","0x250281ff90b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe2290b20be8c5929d7d4dfe3f8124bad55217fa0dc53210399448a7bddefade7a7e64489c1acbfe65eb42d235e6d54279cd88e4d6d6147862a4e5c6ba2ed44594006c000500ffe659a7a1628cdd93febc04a4e0646ea20e9f5f0ce097d9a05290d4a9e054df4ee5c0"],"header":{"digest":{"logs":["0x0661757261208e08491700000000","0x05617572610101039584bca9a9dd88d4bede8787ce022ddea809cef8ebdbf0d7b17c918e49921c86e6d6aedebc991630f7634b3f3306b6c134e87325f34301de5745df0da0240e"]},"extrinsicsRoot":"0xe52df22c1a9deb8ed460e5d80a3dd8e1090bfd51631f53eca465915089703b92","number":"0xd0a","parentHash":"0xcf5fa8ef2fe76c0d6288535231d21989829933b986d32a3ba452173c5a2074f1","stateRoot":"0x3fe7723fdb1a60938e45b72f1d84f414434b9df4ece367dbb39912ebe1a85e9f"}},"justification":null},"id":7}
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"result": {
|
||||
"block": {
|
||||
"extrinsics": [
|
||||
"0x250281ff90b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe2290b20be8c5929d7d4dfe3f8124bad55217fa0dc53210399448a7bddefade7a7e64489c1acbfe65eb42d235e6d54279cd88e4d6d6147862a4e5c6ba2ed44594006c000600ffe659a7a1628cdd93febc04a4e0646ea20e9f5f0ce097d9a05290d4a9e054df4ee5c0"
|
||||
],
|
||||
"header": {
|
||||
"digest": {
|
||||
"logs": [
|
||||
"0x0661757261208e08491700000000",
|
||||
"0x05617572610101039584bca9a9dd88d4bede8787ce022ddea809cef8ebdbf0d7b17c918e49921c86e6d6aedebc991630f7634b3f3306b6c134e87325f34301de5745df0da0240e"
|
||||
]
|
||||
},
|
||||
"extrinsicsRoot": "0xe52df22c1a9deb8ed460e5d80a3dd8e1090bfd51631f53eca465915089703b92",
|
||||
"number": "0xd0a",
|
||||
"parentHash": "0xcf5fa8ef2fe76c0d6288535231d21989829933b986d32a3ba452173c5a2074f1",
|
||||
"stateRoot": "0x3fe7723fdb1a60938e45b72f1d84f414434b9df4ece367dbb39912ebe1a85e9f"
|
||||
}
|
||||
},
|
||||
"justification": null
|
||||
},
|
||||
"id": 7
|
||||
}
|
||||
|
||||
@@ -1 +1,24 @@
|
||||
{"jsonrpc":"2.0","result":{"block":{"extrinsics":["0x20010100036022245d","0x14010a004d34","0x290281ff90b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22f2040bbcf048e6bfb68c0722fe379c93afbc8f885ee21fc5b5679d4ade606a7d46cf151a2b8ad5bbce6ee198a41e3251302f5e9c64f457dbeacacf3e43b448087033000500ffe659a7a1628cdd93febc04a4e0646ea20e9f5f0ce097d9a05290d4a9e054df4ee5c0"],"header":{"digest":{"logs":["0x0661757261209808491700000000","0x0561757261010195888c7f16b54cf99117933d503faea1a7a8bdab4b6a8144c078b6c3d9e55d3a1114af92b2360a0694a057df016e1ad2bd750d43411464b9e7414e921cfdc00b"]},"extrinsicsRoot":"0x751fc4dfad59fefd3c4f730596f1a742b56c9936b4e3d4801015472261a0ce48","number":"0xd14","parentHash":"0x497b3b929ae079f6f0d280ba85744b87559eaab8969619be5cc7596c5a974cb9","stateRoot":"0x011c352e0f97cad72578f9e1e8ec759096365b891928d6b094d0d8d329f9bbab"}},"justification":null},"id":8}
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"result": {
|
||||
"block": {
|
||||
"extrinsics": [
|
||||
"0x290281ff90b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22f2040bbcf048e6bfb68c0722fe379c93afbc8f885ee21fc5b5679d4ade606a7d46cf151a2b8ad5bbce6ee198a41e3251302f5e9c64f457dbeacacf3e43b448087033000600ffe659a7a1628cdd93febc04a4e0646ea20e9f5f0ce097d9a05290d4a9e054df4ee5c0"
|
||||
],
|
||||
"header": {
|
||||
"digest": {
|
||||
"logs": [
|
||||
"0x0661757261209808491700000000",
|
||||
"0x0561757261010195888c7f16b54cf99117933d503faea1a7a8bdab4b6a8144c078b6c3d9e55d3a1114af92b2360a0694a057df016e1ad2bd750d43411464b9e7414e921cfdc00b"
|
||||
]
|
||||
},
|
||||
"extrinsicsRoot": "0x751fc4dfad59fefd3c4f730596f1a742b56c9936b4e3d4801015472261a0ce48",
|
||||
"number": "0xd14",
|
||||
"parentHash": "0x497b3b929ae079f6f0d280ba85744b87559eaab8969619be5cc7596c5a974cb9",
|
||||
"stateRoot": "0x011c352e0f97cad72578f9e1e8ec759096365b891928d6b094d0d8d329f9bbab"
|
||||
}
|
||||
},
|
||||
"justification": null
|
||||
},
|
||||
"id": 8
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ describe('Extrinsic', (): void => {
|
||||
'b0aa1aae6be7a05c9413a172b0325e4d214e5ff2b25098028b30f1a50be9c90e' +
|
||||
'0c' + // nonce
|
||||
'00' + // era
|
||||
'0500' + // balances.transfer
|
||||
'0600' + // balances.transfer
|
||||
'ff' +
|
||||
'4a83f1c09be797bc3d9adce29818368b276a84e6b545ced492c25c948978d7f8' +
|
||||
'e5c0'
|
||||
@@ -37,7 +37,7 @@ describe('Extrinsic', (): void => {
|
||||
expect(extrinsic.signature.toHex()).toEqual('0xc0aa4df3b4926c3cd78bbdced31d8bdccb8604b779b71b90e58b2848df4a9ad6b0aa1aae6be7a05c9413a172b0325e4d214e5ff2b25098028b30f1a50be9c90e');
|
||||
expect(extrinsic.nonce.toNumber()).toEqual(3);
|
||||
expect(extrinsic.era.toU8a()).toEqual(new Uint8Array([0]));
|
||||
expect(extrinsic.callIndex).toEqual(new Uint8Array([5, 0]));
|
||||
expect(extrinsic.callIndex).toEqual(new Uint8Array([6, 0]));
|
||||
expect(`${extrinsic.method.sectionName}.${extrinsic.method.methodName}`).toEqual('balances.transfer');
|
||||
expect(extrinsic.args[0].toString()).toEqual('5DkQbYAExs3M2sZgT1Ec3mKfZnAQCL4Dt9beTCknkCUn5jzo');
|
||||
});
|
||||
@@ -52,7 +52,7 @@ describe('Extrinsic', (): void => {
|
||||
'b0aa1aae6be7a05c9413a172b0325e4d214e5ff2b25098028b30f1a50be9c90e' +
|
||||
'0c' +
|
||||
'00' +
|
||||
'0500' + // balances.transfer
|
||||
'0600' + // balances.transfer
|
||||
'ff' +
|
||||
'4a83f1c09be797bc3d9adce29818368b276a84e6b545ced492c25c948978d7f8' +
|
||||
'e5c0'
|
||||
@@ -63,7 +63,7 @@ describe('Extrinsic', (): void => {
|
||||
expect(extrinsic.signature.toHex()).toEqual('0xc0aa4df3b4926c3cd78bbdced31d8bdccb8604b779b71b90e58b2848df4a9ad6b0aa1aae6be7a05c9413a172b0325e4d214e5ff2b25098028b30f1a50be9c90e');
|
||||
expect(extrinsic.nonce.toNumber()).toEqual(3);
|
||||
expect(extrinsic.era.toU8a()).toEqual(new Uint8Array([0]));
|
||||
expect(extrinsic.callIndex).toEqual(new Uint8Array([5, 0]));
|
||||
expect(extrinsic.callIndex).toEqual(new Uint8Array([6, 0]));
|
||||
expect(`${extrinsic.method.sectionName}.${extrinsic.method.methodName}`).toEqual('balances.transfer');
|
||||
expect(extrinsic.args[0].toString()).toEqual('5DkQbYAExs3M2sZgT1Ec3mKfZnAQCL4Dt9beTCknkCUn5jzo');
|
||||
});
|
||||
@@ -82,7 +82,7 @@ describe('Extrinsic', (): void => {
|
||||
'00' + // era
|
||||
'0c' + // nonce
|
||||
'08' + // tip
|
||||
'0500' + // balances.transfer
|
||||
'0600' + // balances.transfer
|
||||
'ff' +
|
||||
'4a83f1c09be797bc3d9adce29818368b276a84e6b545ced492c25c948978d7f8' +
|
||||
'e5c0'
|
||||
@@ -94,7 +94,7 @@ describe('Extrinsic', (): void => {
|
||||
expect(extrinsic.era.toU8a()).toEqual(new Uint8Array([0]));
|
||||
expect(extrinsic.nonce.toNumber()).toEqual(3);
|
||||
expect(extrinsic.tip.toNumber()).toEqual(2);
|
||||
expect(extrinsic.callIndex).toEqual(new Uint8Array([5, 0]));
|
||||
expect(extrinsic.callIndex).toEqual(new Uint8Array([6, 0]));
|
||||
expect(`${extrinsic.method.sectionName}.${extrinsic.method.methodName}`).toEqual('balances.transfer');
|
||||
expect(extrinsic.args[0].toString()).toEqual('5DkQbYAExs3M2sZgT1Ec3mKfZnAQCL4Dt9beTCknkCUn5jzo');
|
||||
});
|
||||
@@ -110,7 +110,7 @@ describe('Extrinsic', (): void => {
|
||||
'00' + // era
|
||||
'00' + // nonce
|
||||
'00' + // tip
|
||||
'0500' + // balances.transfer
|
||||
'0600' + // balances.transfer
|
||||
'ff' +
|
||||
'4a83f1c09be797bc3d9adce29818368b276a84e6b545ced492c25c948978d7f8' +
|
||||
'e5c0';
|
||||
|
||||
@@ -12,7 +12,7 @@ describe('ExtrinsicPayload', (): void => {
|
||||
blockHash: '0xde8f69eeb5e065e18c6950ff708d7e551f68dc9bf59a07c52367c0280f805ec7',
|
||||
era: '0x0703',
|
||||
genesisHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b',
|
||||
method: '0x0500ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c',
|
||||
method: '0x0600ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c',
|
||||
nonce: '0x00001234',
|
||||
specVersion: 123,
|
||||
tip: '0x00000000000000000000000000005678'
|
||||
|
||||
@@ -14,7 +14,7 @@ describe('SignerPayload', (): void => {
|
||||
blockNumber: '0x00231d30',
|
||||
era: '0x0703',
|
||||
genesisHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b',
|
||||
method: '0x0500ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c',
|
||||
method: '0x0600ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c',
|
||||
nonce: '0x00001234',
|
||||
specVersion: '0x00000000',
|
||||
tip: '0x00000000000000000000000000005678',
|
||||
@@ -33,7 +33,7 @@ describe('SignerPayload', (): void => {
|
||||
blockNumber: '0x231d30',
|
||||
era: createType('ExtrinsicEra', { current: 2301232, period: 200 }),
|
||||
genesisHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b',
|
||||
method: createType('Call', '0x0500ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c'),
|
||||
method: createType('Call', '0x0600ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c'),
|
||||
nonce: 0x1234,
|
||||
tip: 0x5678,
|
||||
version: 3
|
||||
@@ -44,7 +44,7 @@ describe('SignerPayload', (): void => {
|
||||
blockNumber: '0x00231d30',
|
||||
era: '0x0703',
|
||||
genesisHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b',
|
||||
method: '0x0500ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c',
|
||||
method: '0x0600ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c',
|
||||
nonce: '0x00001234',
|
||||
specVersion: '0x00000000',
|
||||
tip: '0x00000000000000000000000000005678',
|
||||
|
||||
@@ -29,7 +29,7 @@ describe('ExtrinsicV2', (): void => {
|
||||
).toHex()
|
||||
).toEqual(
|
||||
'0x' +
|
||||
'0500' + // balance.transfer
|
||||
'0600' + // balance.transfer
|
||||
'ff' +
|
||||
'd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9' +
|
||||
'e56c'
|
||||
@@ -58,10 +58,10 @@ describe('ExtrinsicV2', (): void => {
|
||||
'0x' +
|
||||
'ff' +
|
||||
'd172a74cda4c865912c32ba0a80a57ae69abae410e5ccb59dee84e2f4432db4f' +
|
||||
'975c79b3c7c57898153faa55a97744f71aa8b4c44ec319978c1206f7941db65e' +
|
||||
'6cea25fe0bc700f8cb3c5eeef3894b21ed88398e8d8ab93b6af2e9d2fd9f5404' +
|
||||
'4f47f2d47095239adcb8b725c2c950348c0f65a5019b91e0946636c6c2424cdc' +
|
||||
'6c0cece073e18b40ba13d2dd3afcc0daa0f223fa6a8f59d1e025a2dde1d1200a' +
|
||||
'000408' + // era. nonce, tip
|
||||
'0500' +
|
||||
'0600' +
|
||||
'ff' +
|
||||
'd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9' +
|
||||
'e56c'
|
||||
|
||||
@@ -29,7 +29,7 @@ describe('ExtrinsicV3', (): void => {
|
||||
).toHex()
|
||||
).toEqual(
|
||||
'0x' +
|
||||
'0500' + // balance.transfer
|
||||
'0600' + // balance.transfer
|
||||
'ff' +
|
||||
'd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9' +
|
||||
'e56c'
|
||||
@@ -58,10 +58,10 @@ describe('ExtrinsicV3', (): void => {
|
||||
'0x' +
|
||||
'ff' +
|
||||
'd172a74cda4c865912c32ba0a80a57ae69abae410e5ccb59dee84e2f4432db4f' +
|
||||
'21de8ff3cae3ee72ced565ed5f79fd153dc84a3be9166b7904eecde8045ba59a' +
|
||||
'd2f998cc970e59157f168ec762eea061f4930b5288f57a45a1c1911863860208' +
|
||||
'b8065808da3d11ddb4167afb156eafb51e8104ba792589bb443653a7fab82b90' +
|
||||
'c6530e838df06bfc8befcbbcfca7e219350cff865439b815b10b8e64ae1e9b01' +
|
||||
'000408' + // era. nonce, tip
|
||||
'0500' +
|
||||
'0600' +
|
||||
'ff' +
|
||||
'd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9' +
|
||||
'e56c'
|
||||
|
||||
@@ -15,15 +15,15 @@ describe('Call', (): void => {
|
||||
expect(
|
||||
new Call({
|
||||
args: [],
|
||||
callIndex: [5, 1] // balances.setBalance
|
||||
callIndex: [6, 1] // balances.setBalance
|
||||
}).toU8a()
|
||||
).toEqual(new Uint8Array([5, 1, 0, 0, 0]));
|
||||
).toEqual(new Uint8Array([6, 1, 0, 0, 0]));
|
||||
});
|
||||
|
||||
it('handles creation from a hex value properly', (): void => {
|
||||
expect(
|
||||
new Call('0x0501').toU8a()
|
||||
).toEqual(new Uint8Array([5, 1, 0, 0, 0])); // balances.setBalance
|
||||
new Call('0x0601').toU8a()
|
||||
).toEqual(new Uint8Array([6, 1, 0, 0, 0])); // balances.setBalance
|
||||
});
|
||||
|
||||
describe('hasOrigin', (): void => {
|
||||
|
||||
Reference in New Issue
Block a user