Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions packages/txwrapper-dev/src/constants/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import {
polkadotV9122MetadataHex,
polkadotV9340MetadataHex,
polkadotV9350MetadataHex,
} from '../metadata/';
import { kusamaV9160MetadataHex } from '../metadata/kusama/kusamaV9160MetadataHex';
import { kusamaV9320MetadataHex } from '../metadata/kusama/kusamaV9320MetadataHex';
import { polkadotV9122MetadataHex } from '../metadata/polkadot/polkadotV9122MetadataHex';
import { polkadotV9350MetadataHex } from '../metadata/polkadot/polkadotV9350MetadataHex';
import { metadataRpc } from '../metadata/static/staticV3-1-1';
import { metadataRpcV29 } from '../metadata/static/staticV4-3-1';
import { getRegistryKusama, getRegistryPolkadot } from '../registries';
Expand Down Expand Up @@ -92,6 +95,14 @@ export const KUSAMA_9320_TEST_OPTIONS = {
registry: getRegistryKusama(9320, kusamaV9320MetadataHex),
};

/**
* Test options for runtime v9340 Polkadot
*/
export const POLKADOT_9340_TEST_OPTIONS = {
metadataRpc: polkadotV9340MetadataHex,
registry: getRegistryPolkadot(9340, polkadotV9340MetadataHex),
};

/**
* Test options for runtime v9350 Polkadot
*/
Expand Down
2 changes: 2 additions & 0 deletions packages/txwrapper-dev/src/metadata/polkadot/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export * from './polkadotV9122MetadataHex';
export * from './polkadotV9340MetadataHex';
export * from './polkadotV9350MetadataHex';

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion packages/txwrapper-examples/multisig/src/multisig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,6 @@ async function main(): Promise<void> {
index: multisigCallIndex,
},
call: unsignedTXMultiEncodedMethod,
storeCall: false,
maxWeight: { refTime: '640000000', proofSize: '0' },
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
itHasCorrectBaseTxInfo,
KUSAMA_9320_TEST_OPTIONS,
POLKADOT_9340_TEST_OPTIONS,
TEST_BASE_TX_INFO,
} from '@substrate/txwrapper-dev';

Expand All @@ -13,21 +13,21 @@ describe('multisig::asMulti', () => {
const unsigned = asMulti(
TEST_METHOD_ARGS.multisig.asMulti,
TEST_BASE_TX_INFO,
KUSAMA_9320_TEST_OPTIONS
POLKADOT_9340_TEST_OPTIONS
);

itHasCorrectBaseTxInfo(unsigned);

expect(unsigned.method).toBe(
'0x1f0102000cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a4890b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22017b00000003000000040300cc5fc7439d3c49984e7345319de148561cd930748fb401276d289f714acdd50c2813f6ffffffffff3f0100'
'0x1e0102000cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a4890b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22017b00000003000000040300cc5fc7439d3c49984e7345319de148561cd930748fb401276d289f714acdd50c280000000013f6ffffffffff3f0100'
);
});

it('should accept another txwrapper method as a `call`', () => {
const unsignedBalancesTransferKeepAlive = transferKeepAlive(
TEST_METHOD_ARGS.balances.transferKeepAlive,
TEST_BASE_TX_INFO,
KUSAMA_9320_TEST_OPTIONS
POLKADOT_9340_TEST_OPTIONS
);

const unsignedAsMulti = asMulti(
Expand All @@ -36,13 +36,13 @@ describe('multisig::asMulti', () => {
call: unsignedBalancesTransferKeepAlive.method,
},
TEST_BASE_TX_INFO,
KUSAMA_9320_TEST_OPTIONS
POLKADOT_9340_TEST_OPTIONS
);

itHasCorrectBaseTxInfo(unsignedAsMulti);

expect(unsignedAsMulti.method).toBe(
'0x1f0102000cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a4890b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22017b0000000300000004030096074594cccf1cd185fa8a72ceaeefd86648f8d45514f3ce33c31bdd07e4655d3013f6ffffffffff3f0100'
'0x1e0102000cd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a4890b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22017b0000000300000005030096074594cccf1cd185fa8a72ceaeefd86648f8d45514f3ce33c31bdd07e4655d3013f6ffffffffff3f0100'
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ export interface MultisigAsMulti
* The call to be executed as a SCALE encoded hex string.
*/
call: string;
/**
* Wether or not to store the call in the pallet storage item `Calls`. Storing the call
* is normally only useful if this is the first approval, threshold > 1, and you
* want the call stored on chain so others can see. The call will always be
* removed from storage once the call is executed.
*/
storeCall: boolean;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ export const TEST_METHOD_ARGS = {
index: 3,
},
call: '0x040300cc5fc7439d3c49984e7345319de148561cd930748fb401276d289f714acdd50c28',
storeCall: false,
maxWeight: { refTime: '90071992547409910', proofSize: '0' },
},
},
Expand Down