@substrate/api-sidecar 9.2.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/package.json +11 -11
- package/build/src/chains-config/metadata-consts/kusamaConsts.js +1 -1
- package/build/src/chains-config/metadata-consts/kusamaConsts.js.map +1 -1
- package/build/src/chains-config/metadata-consts/polkadotConsts.js +1 -0
- package/build/src/chains-config/metadata-consts/polkadotConsts.js.map +1 -1
- package/build/src/chains-config/metadata-consts/westendConsts.js +1 -0
- package/build/src/chains-config/metadata-consts/westendConsts.js.map +1 -1
- package/build/src/controllers/blocks/BlocksController.js +5 -2
- package/build/src/controllers/blocks/BlocksController.js.map +1 -1
- package/build/src/controllers/blocks/BlocksExtrinsicsController.js +2 -1
- package/build/src/controllers/blocks/BlocksExtrinsicsController.js.map +1 -1
- package/build/src/controllers/pallets/PalletsStorageController.js +12 -6
- package/build/src/controllers/pallets/PalletsStorageController.js.map +1 -1
- package/build/src/services/accounts/AccountsAssetsService.spec.js +107 -1
- package/build/src/services/accounts/AccountsAssetsService.spec.js.map +1 -1
- package/build/src/services/accounts/AccountsBalanceInfoService.spec.js +80 -45
- package/build/src/services/accounts/AccountsBalanceInfoService.spec.js.map +1 -1
- package/build/src/services/accounts/AccountsStakingInfoService.spec.d.ts +4 -1
- package/build/src/services/accounts/AccountsStakingInfoService.spec.js +23 -7
- package/build/src/services/accounts/AccountsStakingInfoService.spec.js.map +1 -1
- package/build/src/services/accounts/AccountsVestingInfoService.spec.js +11 -1
- package/build/src/services/accounts/AccountsVestingInfoService.spec.js.map +1 -1
- package/build/src/services/blocks/BlocksService.d.ts +2 -1
- package/build/src/services/blocks/BlocksService.js +29 -26
- package/build/src/services/blocks/BlocksService.js.map +1 -1
- package/build/src/services/blocks/BlocksService.spec.js +77 -43
- package/build/src/services/blocks/BlocksService.spec.js.map +1 -1
- package/build/src/services/blocks/BlocksTraceService.spec.js +1 -1
- package/build/src/services/blocks/BlocksTraceService.spec.js.map +1 -1
- package/build/src/services/node/NodeNetworkService.spec.js +1 -1
- package/build/src/services/node/NodeNetworkService.spec.js.map +1 -1
- package/build/src/services/node/NodeTransactionPoolService.spec.js +5 -5
- package/build/src/services/node/NodeTransactionPoolService.spec.js.map +1 -1
- package/build/src/services/node/NodeVersionService.spec.js +1 -1
- package/build/src/services/node/NodeVersionService.spec.js.map +1 -1
- package/build/src/services/pallets/PalletsAssetsService.spec.js +113 -1
- package/build/src/services/pallets/PalletsAssetsService.spec.js.map +1 -1
- package/build/src/services/pallets/PalletsStakingProgressService.spec.js +48 -7
- package/build/src/services/pallets/PalletsStakingProgressService.spec.js.map +1 -1
- package/build/src/services/pallets/PalletsStorageService.d.ts +14 -2
- package/build/src/services/pallets/PalletsStorageService.js +56 -11
- package/build/src/services/pallets/PalletsStorageService.js.map +1 -1
- package/build/src/services/pallets/PalletsStorageService.spec.js +29 -7
- package/build/src/services/pallets/PalletsStorageService.spec.js.map +1 -1
- package/build/src/services/paras/ParasService.spec.d.ts +10 -1
- package/build/src/services/paras/ParasService.spec.js +201 -8
- package/build/src/services/paras/ParasService.spec.js.map +1 -1
- package/build/src/services/runtime/RuntimeCodeService.spec.js +1 -1
- package/build/src/services/runtime/RuntimeCodeService.spec.js.map +1 -1
- package/build/src/services/runtime/RuntimeMetadataService.spec.js +1 -1
- package/build/src/services/runtime/RuntimeMetadataService.spec.js.map +1 -1
- package/build/src/services/runtime/RuntimeSpecService.spec.js +1 -1
- package/build/src/services/runtime/RuntimeSpecService.spec.js.map +1 -1
- package/build/src/services/test-helpers/mock/mockApi.d.ts +4 -13
- package/build/src/services/test-helpers/mock/mockApi.js +3 -378
- package/build/src/services/test-helpers/mock/mockApi.js.map +1 -1
- package/build/src/services/transaction/TransactionFeeEstimateService.spec.js +6 -3
- package/build/src/services/transaction/TransactionFeeEstimateService.spec.js.map +1 -1
- package/build/src/services/transaction/TransactionMaterialService.spec.js +1 -1
- package/build/src/services/transaction/TransactionMaterialService.spec.js.map +1 -1
- package/build/src/services/transaction/TransactionSubmitService.spec.js +8 -7
- package/build/src/services/transaction/TransactionSubmitService.spec.js.map +1 -1
- package/build/src/test-helpers/metadata/polkadotV9110Metadata.d.ts +1 -0
- package/build/src/test-helpers/metadata/polkadotV9110Metadata.js +5 -0
- package/build/src/test-helpers/metadata/polkadotV9110Metadata.js.map +1 -0
- package/build/src/test-helpers/registries/polkadotRegistry.d.ts +4 -0
- package/build/src/test-helpers/registries/polkadotRegistry.js +6 -1
- package/build/src/test-helpers/registries/polkadotRegistry.js.map +1 -1
- package/package.json +11 -11
|
@@ -3,19 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
const bn_js_1 = __importDefault(require("bn.js"));
|
|
8
|
-
const rococoMetadata_1 = require("../../..//test-helpers/metadata/rococoMetadata");
|
|
6
|
+
exports.defaultMockApi = exports.tx = exports.pendingExtrinsics = exports.submitExtrinsic = exports.queryInfoBalancesTransfer = exports.ledgerAt = exports.bondedAt = exports.erasStartSessionIndexAt = exports.activeEraAt = exports.deriveGetBlock = exports.getBlock = void 0;
|
|
9
7
|
const metadata_1 = require("../../../test-helpers/metadata/metadata");
|
|
10
|
-
const statemintMetadata_1 = require("../../../test-helpers/metadata/statemintMetadata");
|
|
11
8
|
const registries_1 = require("../../../test-helpers/registries");
|
|
12
|
-
const typeFactory_1 = require("../../../test-helpers/typeFactory");
|
|
13
9
|
const _1 = require(".");
|
|
14
|
-
const events789629Hex_1 = require("./data/events789629Hex");
|
|
15
10
|
const localListenAddresses_1 = require("./data/localListenAddresses");
|
|
16
11
|
const traceBlock_json_1 = __importDefault(require("./data/traceBlock.json"));
|
|
17
|
-
const validators789629Hex_1 = require("./data/validators789629Hex");
|
|
18
|
-
const eventsAt = (_hash) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('Vec<EventRecord>', events789629Hex_1.events789629));
|
|
19
12
|
const chain = () => Promise.resolve().then(() => {
|
|
20
13
|
return registries_1.polkadotRegistry.createType('Text', 'Polkadot');
|
|
21
14
|
});
|
|
@@ -50,15 +43,6 @@ const deriveGetHeader = () => Promise.resolve().then(() => {
|
|
|
50
43
|
author: registries_1.polkadotRegistry.createType('AccountId', '1zugcajGg5yDD9TEqKKzGx7iKuGWZMkRbYcyaFnaUaEkwMK'),
|
|
51
44
|
};
|
|
52
45
|
});
|
|
53
|
-
const nextFeeMultiplierAt = (_hash) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('Fixed128', 1000000000));
|
|
54
|
-
const validatorCountAt = (_hash) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('u32', 197));
|
|
55
|
-
const forceEraAt = (_hash) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('Forcing', 'NotForcing'));
|
|
56
|
-
const eraElectionStatusAt = (_hash) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('ElectionStatus', { Close: null }));
|
|
57
|
-
const validatorsAt = (_hash) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('Vec<ValidatorId>', validators789629Hex_1.validators789629Hex));
|
|
58
|
-
const currentSlotAt = (_hash) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('u64', 265876724));
|
|
59
|
-
const epochIndexAt = (_hash) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('u64', 330));
|
|
60
|
-
const genesisSlotAt = (_hash) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('u64', 265084563));
|
|
61
|
-
const currentIndexAt = (_hash) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('SessionIndex', 330));
|
|
62
46
|
const version = () => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('Text', '0.8.22-c6ee8675-x86_64-linux-gnu'));
|
|
63
47
|
const activeEraAt = (_hash) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('Option<ActiveEraInfo>', {
|
|
64
48
|
index: 49,
|
|
@@ -67,16 +51,10 @@ const activeEraAt = (_hash) => Promise.resolve().then(() => registries_1.polkado
|
|
|
67
51
|
exports.activeEraAt = activeEraAt;
|
|
68
52
|
const erasStartSessionIndexAt = (_hash, _activeEra) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('Option<SessionIndex>', 330));
|
|
69
53
|
exports.erasStartSessionIndexAt = erasStartSessionIndexAt;
|
|
70
|
-
const unappliedSlashesAt = (_hash, _activeEra) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('Vec<UnappliedSlash>', []));
|
|
71
|
-
const locksAt = (_hash, _address) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('Vec<BalanceLock>', '0x047374616b696e672000e8764817000000000000000000000002'));
|
|
72
|
-
const accountAt = (_hash, _address) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('AccountInfo', '0x0600000003dbb656ab7400000000000000000000000000000000000000000000000000000000e8764817000000000000000000000000e87648170000000000000000000000'));
|
|
73
54
|
const bondedAt = (_hash, _address) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('Option<AccountId>', _1.testAddressController));
|
|
74
55
|
exports.bondedAt = bondedAt;
|
|
75
|
-
const vestingAt = (_hash, _address) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('Option<VestingInfo>', null));
|
|
76
56
|
const ledgerAt = (_hash, _address) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('Option<StakingLedger>', '0x2c2a55b5e0d28cc772b47bb9b25981cbb69eca73f7c3388fb6464e7d24be470e0700e87648170700e8764817008c000000000100000002000000030000000400000005000000060000000700000008000000090000001700000018000000190000001a0000001b0000001c0000001d0000001e0000001f000000200000002100000022000000230000002400000025000000260000002700000028000000290000002a0000002b0000002c0000002d0000002e0000002f000000'));
|
|
77
57
|
exports.ledgerAt = ledgerAt;
|
|
78
|
-
const payeeAt = (_hash, _address) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('RewardDestination', 'Controller'));
|
|
79
|
-
const slashingSpansAt = (_hash, _address) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('SlashingSpans'));
|
|
80
58
|
// For getting the blockhash of the genesis block
|
|
81
59
|
const getBlockHashGenesis = (_zero) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('BlockHash', '0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3'));
|
|
82
60
|
const queryInfoBalancesTransfer = (_extrinsic, _hash) => Promise.resolve().then(() => registries_1.polkadotRegistry.createType('RuntimeDispatchInfo', {
|
|
@@ -105,370 +83,17 @@ const pendingExtrinsics = () => Promise.resolve().then(() => registries_1.polkad
|
|
|
105
83
|
exports.pendingExtrinsics = pendingExtrinsics;
|
|
106
84
|
const tx = () => registries_1.polkadotRegistry.createType('Extrinsic', _1.balancesTransferValid);
|
|
107
85
|
exports.tx = tx;
|
|
108
|
-
const referendumInfoOfAt = () => Promise.resolve().then(() => {
|
|
109
|
-
registries_1.polkadotRegistry.createType('ReferendumInfo');
|
|
110
|
-
});
|
|
111
|
-
/**
|
|
112
|
-
* ParasService specific constants
|
|
113
|
-
* The below types and constants use the rococo registry in order to properly
|
|
114
|
-
* test the ParasService with accurate metadata
|
|
115
|
-
*/
|
|
116
|
-
const rococoApi = (0, typeFactory_1.createApiWithAugmentations)(rococoMetadata_1.rococoMetadataV228);
|
|
117
|
-
const rococoTypeFactory = new typeFactory_1.TypeFactory(rococoApi);
|
|
118
|
-
/**
|
|
119
|
-
* Used for parachain crowdloans
|
|
120
|
-
*/
|
|
121
|
-
const funds = {
|
|
122
|
-
depositor: registries_1.rococoRegistry.createType('AccountId', '14E5nqKAp3oAJcmzgZhUD2RcptBeUBScxKHgJKU4HPNcKVf3'),
|
|
123
|
-
verifier: null,
|
|
124
|
-
deposit: registries_1.rococoRegistry.createType('Balance', 100000000000000),
|
|
125
|
-
raised: registries_1.rococoRegistry.createType('Balance', 627500000000000),
|
|
126
|
-
end: registries_1.rococoRegistry.createType('BlockNumber', 200000),
|
|
127
|
-
cap: registries_1.rococoRegistry.createType('Balance', '0x0000000000000000016345785d8a0000'),
|
|
128
|
-
lastContribution: registries_1.rococoRegistry.createType('LastContribution', {
|
|
129
|
-
preEnding: 6,
|
|
130
|
-
}),
|
|
131
|
-
firstPeriod: registries_1.rococoRegistry.createType('LeasePeriod', 13),
|
|
132
|
-
lastPeriod: registries_1.rococoRegistry.createType('LeasePeriod', 16),
|
|
133
|
-
trieIndex: registries_1.rococoRegistry.createType('TrieIndex', 60),
|
|
134
|
-
};
|
|
135
|
-
const paraLifecycleObjectOne = {
|
|
136
|
-
onboarding: true,
|
|
137
|
-
parachain: true,
|
|
138
|
-
};
|
|
139
|
-
const paraLifecycleObjectTwo = {
|
|
140
|
-
parathread: true,
|
|
141
|
-
parachain: false,
|
|
142
|
-
};
|
|
143
|
-
const crowdloanParaId1 = rococoTypeFactory.storageKey(199, 'ParaId', rococoApi.query.crowdloan.funds);
|
|
144
|
-
const crowdloanParaId2 = rococoTypeFactory.storageKey(200, 'ParaId', rococoApi.query.crowdloan.funds);
|
|
145
|
-
const paraLifecycleOne = registries_1.rococoRegistry.createType('ParaLifecycle', paraLifecycleObjectOne);
|
|
146
|
-
const paraLifecycleTwo = registries_1.rococoRegistry.createType('ParaLifecycle', paraLifecycleObjectTwo);
|
|
147
|
-
const accountIdOne = registries_1.rococoRegistry.createType('AccountId', '1TYrFCWxwHA5bhiXf6uLvPfG6eEvrzzL7uiPK3Yc6yHLUqc');
|
|
148
|
-
const accountIdTwo = registries_1.rococoRegistry.createType('AccountId', '13NXiLYYzVEjXxU3eaZNcrjEX9vPyVDNNpURCzK8Bj9BiCWH');
|
|
149
|
-
const balanceOfOne = registries_1.rococoRegistry.createType('BalanceOf', 1000000);
|
|
150
|
-
const balanceOfTwo = registries_1.rococoRegistry.createType('BalanceOf', 2000000);
|
|
151
|
-
const fundsEntries = () => Promise.resolve().then(() => {
|
|
152
|
-
const optionFundInfo = registries_1.rococoRegistry.createType('Option<FundInfo>', funds);
|
|
153
|
-
const entries = [
|
|
154
|
-
[crowdloanParaId1, optionFundInfo],
|
|
155
|
-
[crowdloanParaId2, optionFundInfo],
|
|
156
|
-
];
|
|
157
|
-
return entries;
|
|
158
|
-
});
|
|
159
|
-
const fundsAt = () => Promise.resolve().then(() => {
|
|
160
|
-
return registries_1.rococoRegistry.createType('Option<FundInfo>', funds);
|
|
161
|
-
});
|
|
162
|
-
const fundsKeys = () => Promise.resolve().then(() => {
|
|
163
|
-
return [crowdloanParaId1, crowdloanParaId2];
|
|
164
|
-
});
|
|
165
|
-
/**
|
|
166
|
-
* Used for parachain paras
|
|
167
|
-
*/
|
|
168
|
-
const paraLifeCycleParaId1 = rococoTypeFactory.storageKey(199, 'ParaId', rococoApi.query.paras.paraLifecycles);
|
|
169
|
-
const paraLifeCycleParaId2 = rococoTypeFactory.storageKey(200, 'ParaId', rococoApi.query.paras.paraLifecycles);
|
|
170
|
-
const parasLifecyclesEntriesAt = () => Promise.resolve().then(() => {
|
|
171
|
-
return [
|
|
172
|
-
[paraLifeCycleParaId1, paraLifecycleOne],
|
|
173
|
-
[paraLifeCycleParaId2, paraLifecycleTwo],
|
|
174
|
-
];
|
|
175
|
-
});
|
|
176
|
-
const parasGenesisArgsAt = () => Promise.resolve().then(() => {
|
|
177
|
-
return registries_1.rococoRegistry.createType('ParaGenesisArgs', { parachain: true });
|
|
178
|
-
});
|
|
179
|
-
const upcomingParasGenesisAt = () => Promise.resolve().then(() => {
|
|
180
|
-
return registries_1.rococoRegistry.createType('Option<ParaGenesisArgs>', {
|
|
181
|
-
parachain: true,
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
const parasLifecyclesAt = () => Promise.resolve().then(() => {
|
|
185
|
-
return rococoTypeFactory.optionOf(paraLifecycleOne);
|
|
186
|
-
});
|
|
187
|
-
/**
|
|
188
|
-
* Used for parachain leases
|
|
189
|
-
*/
|
|
190
|
-
const leasesParaId1 = rococoTypeFactory.storageKey(199, 'ParaId', rococoApi.query.slots.leases);
|
|
191
|
-
const leasesParaId2 = rococoTypeFactory.storageKey(200, 'ParaId', rococoApi.query.slots.leases);
|
|
192
|
-
const leasesTupleOne = rococoTypeFactory.tupleOf([accountIdOne, balanceOfOne], ['AccountId', 'BalanceOf']);
|
|
193
|
-
const leasesTupleTwo = rococoTypeFactory.tupleOf([accountIdTwo, balanceOfTwo], ['AccountId', 'BalanceOf']);
|
|
194
|
-
const parasOptionsOne = rococoTypeFactory.optionOf(leasesTupleOne);
|
|
195
|
-
const parasOptionsTwo = rococoTypeFactory.optionOf(leasesTupleTwo);
|
|
196
|
-
const vectorLeases = rococoTypeFactory.vecOf([
|
|
197
|
-
parasOptionsOne,
|
|
198
|
-
parasOptionsTwo,
|
|
199
|
-
]);
|
|
200
|
-
exports.emptyVectorLeases = registries_1.rococoRegistry.createType('Vec<Raw>', []);
|
|
201
|
-
const slotsLeasesAt = () => Promise.resolve().then(() => {
|
|
202
|
-
return vectorLeases;
|
|
203
|
-
});
|
|
204
|
-
exports.slotsLeasesAt = slotsLeasesAt;
|
|
205
|
-
const slotsLeasesEntriesAt = () => Promise.resolve().then(() => {
|
|
206
|
-
return [
|
|
207
|
-
[leasesParaId1, vectorLeases],
|
|
208
|
-
[leasesParaId2, vectorLeases],
|
|
209
|
-
];
|
|
210
|
-
});
|
|
211
|
-
/**
|
|
212
|
-
* Used for parachain Auctions
|
|
213
|
-
*/
|
|
214
|
-
const auctionsInfoAt = () => Promise.resolve().then(() => {
|
|
215
|
-
const beingEnd = registries_1.rococoRegistry.createType('BlockNumber', 1000);
|
|
216
|
-
const leasePeriodIndex = registries_1.rococoRegistry.createType('BlockNumber', 39);
|
|
217
|
-
const vectorAuctions = rococoTypeFactory.vecOf([
|
|
218
|
-
leasePeriodIndex,
|
|
219
|
-
beingEnd,
|
|
220
|
-
]);
|
|
221
|
-
const optionAuctions = rococoTypeFactory.optionOf(vectorAuctions);
|
|
222
|
-
return optionAuctions;
|
|
223
|
-
});
|
|
224
|
-
exports.auctionsInfoAt = auctionsInfoAt;
|
|
225
|
-
const noneAuctionsInfoAt = () => Promise.resolve().then(() => registries_1.rococoRegistry.createType('Option<Raw>', null));
|
|
226
|
-
exports.noneAuctionsInfoAt = noneAuctionsInfoAt;
|
|
227
|
-
const auctionCounterAt = () => Promise.resolve().then(() => {
|
|
228
|
-
const counter = new bn_js_1.default(4);
|
|
229
|
-
return counter;
|
|
230
|
-
});
|
|
231
|
-
const auctionsWinningsAt = () => Promise.resolve().then(() => {
|
|
232
|
-
const paraId1 = registries_1.rococoRegistry.createType('ParaId', 199);
|
|
233
|
-
const paraId2 = registries_1.rococoRegistry.createType('ParaId', 200);
|
|
234
|
-
const tupleOne = rococoTypeFactory.tupleOf([accountIdOne, paraId1, balanceOfOne], ['AccountId', 'ParaId', 'BalanceOf']);
|
|
235
|
-
const tupleTwo = rococoTypeFactory.tupleOf([accountIdTwo, paraId2, balanceOfTwo], ['AccountId', 'ParaId', 'BalanceOf']);
|
|
236
|
-
const parasOptionsOne = rococoTypeFactory.optionOf(tupleOne);
|
|
237
|
-
const parasOptionsTwo = rococoTypeFactory.optionOf(tupleTwo);
|
|
238
|
-
// No bids for the remaining slot ranges
|
|
239
|
-
const mockWinningOptions = new Array(8).fill(registries_1.rococoRegistry.createType('Option<Raw>', null) // This is just `Option::None`
|
|
240
|
-
);
|
|
241
|
-
// Total of 10 winning object, 2 `Some(..)`, 8 `None`
|
|
242
|
-
const vectorWinnings = rococoTypeFactory.vecOf([
|
|
243
|
-
parasOptionsOne,
|
|
244
|
-
parasOptionsTwo,
|
|
245
|
-
...mockWinningOptions,
|
|
246
|
-
]);
|
|
247
|
-
const optionWinnings = rococoTypeFactory.optionOf(vectorWinnings);
|
|
248
|
-
return optionWinnings;
|
|
249
|
-
});
|
|
250
86
|
const traceBlock = () => Promise.resolve().then(() => registries_1.kusamaRegistry.createType('TraceBlockResponse', traceBlock_json_1.default.result));
|
|
251
87
|
/**
|
|
252
|
-
*
|
|
253
|
-
* Note: It borrows some variables used in the parachains constant section
|
|
254
|
-
*
|
|
255
|
-
* Used in `/assets` and `/accounts` endpoints
|
|
256
|
-
*/
|
|
257
|
-
const statemintApiV1 = (0, typeFactory_1.createApiWithAugmentations)(statemintMetadata_1.statemintV1);
|
|
258
|
-
const statemintTypeFactory = new typeFactory_1.TypeFactory(statemintApiV1);
|
|
259
|
-
const falseBool = registries_1.rococoRegistry.createType('bool', false);
|
|
260
|
-
const trueBool = registries_1.rococoRegistry.createType('bool', true);
|
|
261
|
-
const assetTBalanceOne = registries_1.rococoRegistry.createType('u64', 10000000);
|
|
262
|
-
const assetTBalanceTwo = registries_1.rococoRegistry.createType('u64', 20000000);
|
|
263
|
-
const assetsInfo = () => Promise.resolve().then(() => {
|
|
264
|
-
const responseObj = {
|
|
265
|
-
owner: accountIdOne,
|
|
266
|
-
issue: accountIdTwo,
|
|
267
|
-
admin: accountIdTwo,
|
|
268
|
-
freezer: accountIdTwo,
|
|
269
|
-
supply: assetTBalanceOne,
|
|
270
|
-
deposit: balanceOfTwo,
|
|
271
|
-
minBalance: registries_1.rococoRegistry.createType('u64', 10000),
|
|
272
|
-
isSufficient: trueBool,
|
|
273
|
-
accounts: registries_1.rococoRegistry.createType('u32', 10),
|
|
274
|
-
sufficients: registries_1.rococoRegistry.createType('u32', 15),
|
|
275
|
-
approvals: registries_1.rococoRegistry.createType('u32', 20),
|
|
276
|
-
isFrozen: falseBool,
|
|
277
|
-
};
|
|
278
|
-
return registries_1.rococoRegistry.createType('AssetDetails', responseObj);
|
|
279
|
-
});
|
|
280
|
-
const assetsMetadata = () => Promise.resolve().then(() => {
|
|
281
|
-
const responseObj = {
|
|
282
|
-
deposit: balanceOfTwo,
|
|
283
|
-
name: registries_1.rococoRegistry.createType('Bytes', 'statemint'),
|
|
284
|
-
symbol: registries_1.rococoRegistry.createType('Bytes', 'DOT'),
|
|
285
|
-
decimals: registries_1.rococoRegistry.createType('u8', 10),
|
|
286
|
-
isFrozen: falseBool,
|
|
287
|
-
};
|
|
288
|
-
return registries_1.rococoRegistry.createType('AssetMetadata', responseObj);
|
|
289
|
-
});
|
|
290
|
-
const assetBalanceObjOne = {
|
|
291
|
-
balance: assetTBalanceOne,
|
|
292
|
-
isFrozen: falseBool,
|
|
293
|
-
sufficient: trueBool,
|
|
294
|
-
};
|
|
295
|
-
const assetBalanceObjTwo = {
|
|
296
|
-
balance: assetTBalanceTwo,
|
|
297
|
-
isFrozen: trueBool,
|
|
298
|
-
sufficient: trueBool,
|
|
299
|
-
};
|
|
300
|
-
const assetBalanceObjThree = {
|
|
301
|
-
balance: assetTBalanceTwo,
|
|
302
|
-
isFrozen: falseBool,
|
|
303
|
-
sufficient: falseBool,
|
|
304
|
-
};
|
|
305
|
-
const assetBalanceFactory = {
|
|
306
|
-
'10': assetBalanceObjOne,
|
|
307
|
-
'20': assetBalanceObjTwo,
|
|
308
|
-
'30': assetBalanceObjThree,
|
|
309
|
-
};
|
|
310
|
-
const assetStorageKeyOne = statemintTypeFactory.storageKey(10, 'AssetId', statemintApiV1.query.assets.asset);
|
|
311
|
-
const assetStorageKeyTwo = statemintTypeFactory.storageKey(20, 'AssetId', statemintApiV1.query.assets.asset);
|
|
312
|
-
const assetStorageKeyThree = statemintTypeFactory.storageKey(30, 'AssetId', statemintApiV1.query.assets.asset);
|
|
313
|
-
const assetsAccountKeysAt = () => Promise.resolve().then(() => {
|
|
314
|
-
return [assetStorageKeyOne, assetStorageKeyTwo, assetStorageKeyThree];
|
|
315
|
-
});
|
|
316
|
-
/**
|
|
317
|
-
* Attach `keysAt` to mockApi.query.assets.asset
|
|
318
|
-
*/
|
|
319
|
-
Object.assign(assetsInfo, {
|
|
320
|
-
keysAt: assetsAccountKeysAt,
|
|
321
|
-
});
|
|
322
|
-
/**
|
|
323
|
-
* @param assetId options are 10, 20, 30
|
|
324
|
-
*/
|
|
325
|
-
const assetsAccount = (assetId, _address) => {
|
|
326
|
-
const id = typeof assetId === 'number' ? assetId : assetId.toNumber();
|
|
327
|
-
switch (id) {
|
|
328
|
-
case 10:
|
|
329
|
-
return assetBalanceFactory[10];
|
|
330
|
-
case 20:
|
|
331
|
-
return assetBalanceFactory[20];
|
|
332
|
-
case 30:
|
|
333
|
-
return assetBalanceFactory[30];
|
|
334
|
-
default:
|
|
335
|
-
return;
|
|
336
|
-
}
|
|
337
|
-
};
|
|
338
|
-
const assetApprovals = () => Promise.resolve().then(() => {
|
|
339
|
-
const assetObj = {
|
|
340
|
-
amount: assetTBalanceOne,
|
|
341
|
-
deposit: balanceOfTwo,
|
|
342
|
-
};
|
|
343
|
-
return registries_1.rococoRegistry.createType('Option<AssetApproval>', assetObj);
|
|
344
|
-
});
|
|
345
|
-
const apiAt = () => Promise.resolve().then(() => {
|
|
346
|
-
return (0, typeFactory_1.createApiWithAugmentations)(metadata_1.polkadotMetadata.toHex());
|
|
347
|
-
});
|
|
348
|
-
exports.apiAt = apiAt;
|
|
349
|
-
/**
|
|
350
|
-
* Mock polkadot-js ApiPromise. Values are largely meant to be accurate for block
|
|
88
|
+
* Deafult Mock polkadot-js ApiPromise. Values are largely meant to be accurate for block
|
|
351
89
|
* #789629, which is what most Service unit tests are based on.
|
|
352
90
|
*/
|
|
353
|
-
exports.
|
|
354
|
-
at: exports.apiAt,
|
|
91
|
+
exports.defaultMockApi = {
|
|
355
92
|
runtimeVersion,
|
|
356
93
|
createType: registries_1.polkadotRegistry.createType.bind(registries_1.polkadotRegistry),
|
|
357
94
|
registry: registries_1.polkadotRegistry,
|
|
358
95
|
tx: exports.tx,
|
|
359
96
|
runtimeMetadata: metadata_1.polkadotMetadata,
|
|
360
|
-
query: {
|
|
361
|
-
assets: {
|
|
362
|
-
account: assetsAccount,
|
|
363
|
-
approvals: assetApprovals,
|
|
364
|
-
asset: assetsInfo,
|
|
365
|
-
metadata: assetsMetadata,
|
|
366
|
-
},
|
|
367
|
-
auctions: {
|
|
368
|
-
auctionInfo: {
|
|
369
|
-
at: exports.auctionsInfoAt,
|
|
370
|
-
},
|
|
371
|
-
auctionCounter: {
|
|
372
|
-
at: auctionCounterAt,
|
|
373
|
-
},
|
|
374
|
-
winning: {
|
|
375
|
-
at: auctionsWinningsAt,
|
|
376
|
-
},
|
|
377
|
-
},
|
|
378
|
-
babe: {
|
|
379
|
-
currentSlot: { at: currentSlotAt },
|
|
380
|
-
epochIndex: { at: epochIndexAt },
|
|
381
|
-
genesisSlot: { at: genesisSlotAt },
|
|
382
|
-
},
|
|
383
|
-
balances: {
|
|
384
|
-
locks: { at: locksAt },
|
|
385
|
-
},
|
|
386
|
-
crowdloan: {
|
|
387
|
-
funds: {
|
|
388
|
-
entriesAt: fundsEntries,
|
|
389
|
-
keys: fundsKeys,
|
|
390
|
-
at: fundsAt,
|
|
391
|
-
},
|
|
392
|
-
},
|
|
393
|
-
paras: {
|
|
394
|
-
paraLifecycles: {
|
|
395
|
-
entriesAt: parasLifecyclesEntriesAt,
|
|
396
|
-
at: parasLifecyclesAt,
|
|
397
|
-
},
|
|
398
|
-
paraGenesisArgs: {
|
|
399
|
-
at: parasGenesisArgsAt,
|
|
400
|
-
},
|
|
401
|
-
upcomingParasGenesis: {
|
|
402
|
-
at: upcomingParasGenesisAt,
|
|
403
|
-
},
|
|
404
|
-
},
|
|
405
|
-
session: {
|
|
406
|
-
currentIndex: { at: currentIndexAt },
|
|
407
|
-
validators: { at: validatorsAt },
|
|
408
|
-
},
|
|
409
|
-
slots: {
|
|
410
|
-
leases: {
|
|
411
|
-
entriesAt: slotsLeasesEntriesAt,
|
|
412
|
-
at: exports.slotsLeasesAt,
|
|
413
|
-
},
|
|
414
|
-
},
|
|
415
|
-
staking: {
|
|
416
|
-
validatorCount: { at: validatorCountAt },
|
|
417
|
-
forceEra: { at: forceEraAt },
|
|
418
|
-
eraElectionStatus: { at: eraElectionStatusAt },
|
|
419
|
-
activeEra: { at: exports.activeEraAt },
|
|
420
|
-
erasStartSessionIndex: { at: exports.erasStartSessionIndexAt },
|
|
421
|
-
unappliedSlashes: { at: unappliedSlashesAt },
|
|
422
|
-
bonded: { at: exports.bondedAt },
|
|
423
|
-
ledger: { at: exports.ledgerAt },
|
|
424
|
-
payee: { at: payeeAt },
|
|
425
|
-
slashingSpans: { at: slashingSpansAt },
|
|
426
|
-
},
|
|
427
|
-
system: {
|
|
428
|
-
events: { at: eventsAt },
|
|
429
|
-
account: { at: accountAt },
|
|
430
|
-
},
|
|
431
|
-
transactionPayment: {
|
|
432
|
-
nextFeeMultiplier: { at: nextFeeMultiplierAt },
|
|
433
|
-
},
|
|
434
|
-
vesting: {
|
|
435
|
-
vesting: { at: vestingAt },
|
|
436
|
-
},
|
|
437
|
-
democracy: {
|
|
438
|
-
referendumInfoOf: { at: referendumInfoOfAt },
|
|
439
|
-
},
|
|
440
|
-
},
|
|
441
|
-
consts: {
|
|
442
|
-
auctions: {
|
|
443
|
-
endingPeriod: new bn_js_1.default(20000),
|
|
444
|
-
sampleLength: new bn_js_1.default(2),
|
|
445
|
-
leasePeriodsPerSlot: undefined,
|
|
446
|
-
},
|
|
447
|
-
babe: {
|
|
448
|
-
epochDuration: registries_1.polkadotRegistry.createType('u64', 2400),
|
|
449
|
-
},
|
|
450
|
-
transactionPayment: {
|
|
451
|
-
transactionByteFee: registries_1.polkadotRegistry.createType('Balance', 1000000),
|
|
452
|
-
weightToFee: [
|
|
453
|
-
{
|
|
454
|
-
coeffFrac: registries_1.polkadotRegistry.createType('Perbill', 80000000),
|
|
455
|
-
coeffInteger: registries_1.polkadotRegistry.createType('Balance', 0),
|
|
456
|
-
degree: registries_1.polkadotRegistry.createType('u8', 1),
|
|
457
|
-
negative: false,
|
|
458
|
-
},
|
|
459
|
-
],
|
|
460
|
-
},
|
|
461
|
-
slots: {
|
|
462
|
-
leasePeriod: new bn_js_1.default(20000),
|
|
463
|
-
},
|
|
464
|
-
staking: {
|
|
465
|
-
electionLookAhead: registries_1.polkadotRegistry.createType('BlockNumber'),
|
|
466
|
-
sessionsPerEra: registries_1.polkadotRegistry.createType('SessionIndex', 6),
|
|
467
|
-
},
|
|
468
|
-
system: {
|
|
469
|
-
extrinsicBaseWeight: registries_1.polkadotRegistry.createType('u64', 125000000),
|
|
470
|
-
},
|
|
471
|
-
},
|
|
472
97
|
rpc: {
|
|
473
98
|
chain: {
|
|
474
99
|
getHeader,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockApi.js","sourceRoot":"","sources":["../../../../../src/services/test-helpers/mock/mockApi.ts"],"names":[],"mappings":";;;;;;AAmBA,kDAAuB;AAEvB,mFAAoF;AACpF,sEAA2E;AAC3E,wFAA+E;AAC/E,iEAI0C;AAC1C,mEAG2C;AAC3C,wBAKW;AACX,4DAAsD;AACtD,sEAAsE;AACtE,6EAAmD;AACnD,oEAAiE;AAEjE,MAAM,QAAQ,GAAG,CAAC,KAAW,EAAE,EAAE,CAChC,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAC3B,6BAAgB,CAAC,UAAU,CAAC,kBAAkB,EAAE,8BAAY,CAAC,CAC7D,CAAC;AAEH,MAAM,KAAK,GAAG,GAAG,EAAE,CAClB,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;IAC3B,OAAO,6BAAgB,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AACxD,CAAC,CAAC,CAAC;AAEG,MAAM,QAAQ,GAAG,CAAC,KAAW,EAA6B,EAAE,CAClE,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;IAC3B,OAAO;QACN,KAAK,EAAE,kBAAe;KACtB,CAAC;AACH,CAAC,CAAC,CAAC;AALS,QAAA,QAAQ,YAKjB;AAEG,MAAM,cAAc,GAAG,CAC7B,KAAW,EACoC,EAAE,CACjD,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;IAC3B,OAAO;QACN,MAAM,EAAE,6BAAgB,CAAC,UAAU,CAClC,WAAW,EACX,iDAAiD,CACj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BAAiB,EAAjB,yBAAiB;SACjB;KACD;IACD,MAAM,EAAE;QACP,KAAK,EAAE;YACN,SAAS,EAAE,eAAe;YAC1B,QAAQ,EAAE,sBAAc;SACxB;KACD;CACwB,CAAC"}
|
|
@@ -10,7 +10,10 @@ const mock_1 = require("../test-helpers/mock");
|
|
|
10
10
|
const feeEstimateInvalid_json_1 = __importDefault(require("../test-helpers/responses/transaction/feeEstimateInvalid.json"));
|
|
11
11
|
const feeEstimateValid_json_1 = __importDefault(require("../test-helpers/responses/transaction/feeEstimateValid.json"));
|
|
12
12
|
const TransactionFeeEstimateService_1 = require("./TransactionFeeEstimateService");
|
|
13
|
-
const
|
|
13
|
+
const mockApi = {
|
|
14
|
+
...mock_1.defaultMockApi,
|
|
15
|
+
};
|
|
16
|
+
const transactionFeeEstimateService = new TransactionFeeEstimateService_1.TransactionFeeEstimateService(mockApi);
|
|
14
17
|
describe('TransactionFeeEstimateService', () => {
|
|
15
18
|
describe('fetchTransactionFeeEstimate', () => {
|
|
16
19
|
it('works with a valid a transaction', async () => {
|
|
@@ -20,11 +23,11 @@ describe('TransactionFeeEstimateService', () => {
|
|
|
20
23
|
const err = new Error('2: Unable to query dispatch info.: Invalid transaction version');
|
|
21
24
|
err.stack =
|
|
22
25
|
'Error: 2: Unable to query dispatch info.: Invalid transaction version\n ... this is a unit test mock';
|
|
23
|
-
|
|
26
|
+
mockApi.rpc.payment.queryInfo = () => Promise.resolve().then(() => {
|
|
24
27
|
throw err;
|
|
25
28
|
});
|
|
26
29
|
await expect(transactionFeeEstimateService.fetchTransactionFeeEstimate(mock_1.blockHash789629, mock_1.balancesTransferInvalid)).rejects.toStrictEqual(feeEstimateInvalid_json_1.default);
|
|
27
|
-
|
|
30
|
+
mockApi.rpc.payment.queryInfo = mock_1.queryInfoBalancesTransfer;
|
|
28
31
|
});
|
|
29
32
|
});
|
|
30
33
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionFeeEstimateService.spec.js","sourceRoot":"","sources":["../../../../src/services/transaction/TransactionFeeEstimateService.spec.ts"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,+DAA+D;;;;;
|
|
1
|
+
{"version":3,"file":"TransactionFeeEstimateService.spec.js","sourceRoot":"","sources":["../../../../src/services/transaction/TransactionFeeEstimateService.spec.ts"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,+DAA+D;;;;;AAI/D,oEAAiE;AACjE,+CAM8B;AAC9B,4HAA4F;AAC5F,wHAAwF;AACxF,mFAAgF;AAEhF,MAAM,OAAO,GAAG;IACf,GAAG,qBAAc;CACQ,CAAC;AAE3B,MAAM,6BAA6B,GAAG,IAAI,6DAA6B,CACtE,OAAO,CACP,CAAC;AAEF,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC9C,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;QAC5C,EAAE,CAAC,kCAAkC,EAAE,KAAK,IAAI,EAAE;YACjD,MAAM,CACL,IAAA,iCAAe,EACd,MAAM,6BAA6B,CAAC,2BAA2B,CAC9D,sBAAe,EACf,4BAAqB,CACrB,CACD,CACD,CAAC,aAAa,CAAC,+BAAa,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,oEAAoE,EAAE,KAAK,IAAI,EAAE;YACnF,MAAM,GAAG,GAAG,IAAI,KAAK,CACpB,gEAAgE,CAChE,CAAC;YACF,GAAG,CAAC,KAAK;gBACR,uGAAuG,CAAC;YAExG,OAAO,CAAC,GAAG,CAAC,OAAe,CAAC,SAAS,GAAG,GAAG,EAAE,CAC7C,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;gBAC3B,MAAM,GAAG,CAAC;YACX,CAAC,CAAC,CAAC;YAEJ,MAAM,MAAM,CACX,6BAA6B,CAAC,2BAA2B,CACxD,sBAAe,EACf,8BAAuB,CACvB,CACD,CAAC,OAAO,CAAC,aAAa,CAAC,iCAAe,CAAC,CAAC;YAExC,OAAO,CAAC,GAAG,CAAC,OAAe,CAAC,SAAS,GAAG,gCAAyB,CAAC;QACpE,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -7,7 +7,7 @@ const sanitizeNumbers_1 = require("../../sanitize/sanitizeNumbers");
|
|
|
7
7
|
const mock_1 = require("../test-helpers/mock");
|
|
8
8
|
const material789629_json_1 = __importDefault(require("../test-helpers/responses/transaction/material789629.json"));
|
|
9
9
|
const TransactionMaterialService_1 = require("./TransactionMaterialService");
|
|
10
|
-
const transactionMaterialService = new TransactionMaterialService_1.TransactionMaterialService(mock_1.
|
|
10
|
+
const transactionMaterialService = new TransactionMaterialService_1.TransactionMaterialService(mock_1.defaultMockApi);
|
|
11
11
|
describe('TransactionMaterialService', () => {
|
|
12
12
|
describe('getTransactionMaterial', () => {
|
|
13
13
|
it('works when ApiPromise works (block 789629)', async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionMaterialService.spec.js","sourceRoot":"","sources":["../../../../src/services/transaction/TransactionMaterialService.spec.ts"],"names":[],"mappings":";;;;;AAAA,oEAAiE;AACjE,+
|
|
1
|
+
{"version":3,"file":"TransactionMaterialService.spec.js","sourceRoot":"","sources":["../../../../src/services/transaction/TransactionMaterialService.spec.ts"],"names":[],"mappings":";;;;;AAAA,oEAAiE;AACjE,+CAAuE;AACvE,oHAAuF;AACvF,6EAA0E;AAE1E,MAAM,0BAA0B,GAAG,IAAI,uDAA0B,CAChE,qBAAc,CACd,CAAC;AAEF,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC3C,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;QACvC,EAAE,CAAC,4CAA4C,EAAE,KAAK,IAAI,EAAE;YAC3D,MAAM,CACL,IAAA,iCAAe,EACd,MAAM,0BAA0B,CAAC,wBAAwB,CACxD,sBAAe,EACf,KAAK,CACL,CACD,CACD,CAAC,aAAa,CAAC,6BAAc,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -3,14 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
6
|
const registries_1 = require("../../test-helpers/registries");
|
|
9
7
|
const mock_1 = require("../test-helpers/mock");
|
|
10
8
|
const submitFailParse_json_1 = __importDefault(require("../test-helpers/responses/transaction/submitFailParse.json"));
|
|
11
9
|
const submitNodeReject_json_1 = __importDefault(require("../test-helpers/responses/transaction/submitNodeReject.json"));
|
|
12
10
|
const TransactionSubmitService_1 = require("./TransactionSubmitService");
|
|
13
|
-
const
|
|
11
|
+
const mockApi = {
|
|
12
|
+
...mock_1.defaultMockApi,
|
|
13
|
+
};
|
|
14
|
+
const transactionSubmitService = new TransactionSubmitService_1.TransactionSubmitService(mockApi);
|
|
14
15
|
describe('TransactionSubmitService', () => {
|
|
15
16
|
describe('submitTransaction', () => {
|
|
16
17
|
it('works with a valid a transaction', async () => {
|
|
@@ -24,21 +25,21 @@ describe('TransactionSubmitService', () => {
|
|
|
24
25
|
`createType(ExtrinsicV4):: Struct: failed on 'signature':: Struct: cannot decode type Type with value \"0x250284d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d01022f4deae1532ddd0\"`);
|
|
25
26
|
err.stack =
|
|
26
27
|
'Error: createType(ExtrinsicV4):: Struct: failed ... this is a unit test mock';
|
|
27
|
-
|
|
28
|
+
mockApi.tx = () => {
|
|
28
29
|
throw err;
|
|
29
30
|
};
|
|
30
31
|
await expect(transactionSubmitService.submitTransaction(mock_1.balancesTransferInvalid)).rejects.toStrictEqual(submitFailParse_json_1.default);
|
|
31
|
-
|
|
32
|
+
mockApi.tx = mock_1.tx;
|
|
32
33
|
});
|
|
33
34
|
it('throws with "Failed to submit transaction" when the node rejects the transaction', async () => {
|
|
34
35
|
const err = new Error('1012: Transaction is temporarily banned');
|
|
35
36
|
err.stack =
|
|
36
37
|
'Error: 1012: Transaction is temporarily banned ... this is a unit test mock';
|
|
37
|
-
|
|
38
|
+
mockApi.rpc.author.submitExtrinsic = () => Promise.resolve().then(() => {
|
|
38
39
|
throw err;
|
|
39
40
|
});
|
|
40
41
|
await expect(transactionSubmitService.submitTransaction(mock_1.balancesTransferValid)).rejects.toStrictEqual(submitNodeReject_json_1.default);
|
|
41
|
-
|
|
42
|
+
mockApi.rpc.author.submitExtrinsic = mock_1.submitExtrinsic;
|
|
42
43
|
});
|
|
43
44
|
});
|
|
44
45
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionSubmitService.spec.js","sourceRoot":"","sources":["../../../../src/services/transaction/TransactionSubmitService.spec.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"TransactionSubmitService.spec.js","sourceRoot":"","sources":["../../../../src/services/transaction/TransactionSubmitService.spec.ts"],"names":[],"mappings":";;;;;AAIA,8DAAiE;AACjE,+CAM8B;AAC9B,sHAA2F;AAC3F,wHAA6F;AAC7F,yEAAsE;AAEtE,MAAM,OAAO,GAAG;IACf,GAAG,qBAAc;CACQ,CAAC;AAE3B,MAAM,wBAAwB,GAAG,IAAI,mDAAwB,CAAC,OAAO,CAAC,CAAC;AAEvE,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACzC,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;QAClC,EAAE,CAAC,kCAAkC,EAAE,KAAK,IAAI,EAAE;YACjD,OAAO,MAAM,CACZ,wBAAwB,CAAC,iBAAiB,CAAC,4BAAqB,CAAC,CACjE,CAAC,QAAQ,CAAC,aAAa,CAAC;gBACxB,IAAI,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