Skip to content

Commit 1ecf146

Browse files
authored
Revert "feat(dot): integrate the Westend AssetHub chain for tdot"
1 parent 80f465c commit 1ecf146

24 files changed

+86
-116
lines changed

modules/sdk-coin-dot/src/lib/txnSchema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const BaseTransactionSchema = joi.object({
1919
blockHash: joi.string().required(),
2020
genesisHash: joi.string().required(),
2121
specVersion: joi.number().required(),
22-
specName: joi.string().valid('kusama', 'polkadot', 'westend', 'statemint', 'statemine', 'westmint').required(),
22+
specName: joi.string().valid('kusama', 'polkadot', 'westend', 'statemint', 'statemine').required(),
2323
transactionVersion: joi.number().required(),
2424
chainName: joi.string().required(),
2525
eraPeriod: joi.number().required(),

modules/sdk-coin-dot/src/lib/utils.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {
3232
UnstakeBatchCallArgs,
3333
} from './iface';
3434
import { KeyPair } from '.';
35-
import { mainnetMetadataRpc, westendMetadataRpc, westendAssetHubMetadataRpc } from '../resources';
35+
import { mainnetMetadataRpc, westendMetadataRpc } from '../resources';
3636

3737
const PROXY_METHOD_ARG = 2;
3838
// map to retrieve the address encoding format when the key is the asset name
@@ -255,15 +255,7 @@ export class Utils implements BaseUtils {
255255
getMaterial(coinConfig: Readonly<CoinConfig>): Material {
256256
const networkConfig = coinConfig.network as DotNetwork;
257257
const { specName, specVersion, chainName, txVersion, genesisHash } = networkConfig;
258-
let metadataRpc = '';
259-
260-
if (specName === 'westend') {
261-
metadataRpc = westendMetadataRpc;
262-
} else if (specName === 'westmint') {
263-
metadataRpc = westendAssetHubMetadataRpc;
264-
} else {
265-
metadataRpc = mainnetMetadataRpc;
266-
}
258+
const metadataRpc = networkConfig.specName === 'westend' ? westendMetadataRpc : mainnetMetadataRpc;
267259

268260
return {
269261
specName,
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export * from './mainnet';
22
export * from './westend';
3-
export * from './westendAssetHub';

modules/sdk-coin-dot/src/resources/westendAssetHub.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

modules/sdk-coin-dot/test/resources/assetHubMaterialData.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

modules/sdk-coin-dot/test/resources/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ export const rawTx = {
8282
'0xc501840061b18c6dc02ddcabdeac56cb4f21a971cc41cc97640f6f85b073480008c53a0d00aadae7fa1f53e7a5c900b330ff71bee6782cf3c29a2c6f9599162381cd021ad581c74ded89f49ec79adefed64af8ff16649553523dda9cb4f017cbf15681e50ed50121030006010bfadb9bbae251',
8383
unsigned:
8484
'0x2406010bfadb9bbae251d501210300d624000016000000e143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e149799bc9602cb5cf201f3425fb8d253b2d4e61fc119dcab3249f307f594754d',
85-
signedWestendAssetHub:
86-
'0xcd01840061b18c6dc02ddcabdeac56cb4f21a971cc41cc97640f6f85b073480008c53a0d00aadae7fa1f53e7a5c900b330ff71bee6782cf3c29a2c6f9599162381cd021ad581c74ded89f49ec79adefed64af8ff16649553523dda9cb4f017cbf15681e50ed501210300000050010bfadb9bbae251',
87-
unsignedWestendAssetHub:
88-
'0x2450010bfadb9bbae251d50121030000009d880f001000000067f9723393ef76214df0118c34bbbd3dbebc8ed46a10973a8c969d48fe7598c9149799bc9602cb5cf201f3425fb8d253b2d4e61fc119dcab3249f307f594754d00',
8985
batchAll: {
9086
signed: '',
9187
unsigned:

modules/sdk-coin-dot/test/unit/dot.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ describe('DOT:', function () {
4545
sender: '5EGoFA95omzemRssELLDjVenNZ68aXyUeqtKQScXSEBvVJkr',
4646
referenceBlock: '0x149799bc9602cb5cf201f3425fb8d253b2d4e61fc119dcab3249f307f594754d',
4747
blockNumber: 3933,
48-
genesisHash: '0x67f9723393ef76214df0118c34bbbd3dbebc8ed46a10973a8c969d48fe7598c9',
48+
genesisHash: '0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e',
4949
nonce: 200,
50-
specVersion: 1018013,
51-
transactionVersion: 16,
50+
specVersion: 9150,
51+
transactionVersion: 8,
5252
eraPeriod: 64,
53-
chainName: 'Westend Asset Hub',
53+
chainName: 'Westend',
5454
tip: 0,
5555
to: '5Ffp1wJCPu4hzVDTo7XaMLqZSvSadyUQmxWPDw74CBjECSoq',
5656
amount: '10000000000',

modules/sdk-coin-dot/test/unit/transaction.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe('Dot Transaction', () => {
7676
});
7777

7878
describe('should build from raw unsigned tx', async () => {
79-
xit('Transaction size validation', async () => {
79+
it('Transaction size validation', async () => {
8080
const builder = new TransferBuilder(config).material(material);
8181
builder.from(rawTx.transfer.unsigned);
8282
builder
@@ -87,7 +87,7 @@ describe('Dot Transaction', () => {
8787
should.deepEqual(tx.transactionSize(), rawTx.transfer.unsigned.length / 2);
8888
});
8989

90-
xit('Should rebuild different hex if keepAlive is true or false for transferAll txs', async () => {
90+
it('Should rebuild different hex if keepAlive is true or false for transferAll txs', async () => {
9191
const keepAliveFalseBuilder = new TransferBuilder(config).material(material);
9292
keepAliveFalseBuilder.from(rawTx.transferAll.unsignedKeepAliveFalse);
9393
keepAliveFalseBuilder
@@ -200,7 +200,7 @@ describe('Dot Transaction', () => {
200200
});
201201

202202
describe('inputs and outputs', () => {
203-
xit('should generate inputs and output for a batch staking transaction', async () => {
203+
it('should generate inputs and output for a batch staking transaction', async () => {
204204
const builder = new BatchTransactionBuilder(config).material(material);
205205
builder.from(rawTx.stake.batchAll.signed);
206206
builder
@@ -236,7 +236,7 @@ describe('Dot Transaction', () => {
236236
should(tx.outputs[1].coin).eql('tdot');
237237
});
238238

239-
xit('should generate inputs and output for a batch unstaking transaction', async () => {
239+
it('should generate inputs and output for a batch unstaking transaction', async () => {
240240
const builder = new BatchTransactionBuilder(config).material(material);
241241
builder.from(rawTx.unstake.batchAll.signed);
242242
builder
@@ -262,7 +262,7 @@ describe('Dot Transaction', () => {
262262
should(tx.outputs[0].coin).eql('tdot');
263263
});
264264

265-
xit('should generate inputs and output for a stake more transaction', async () => {
265+
it('should generate inputs and output for a stake more transaction', async () => {
266266
const builder = new StakingBuilder(config).material(material);
267267
builder.from(rawTx.stakeMore.signed);
268268
builder
@@ -287,7 +287,7 @@ describe('Dot Transaction', () => {
287287
should(tx.outputs[0].coin).eql('tdot');
288288
});
289289

290-
xit('should generate inputs and output for an unstake transaction', async () => {
290+
it('should generate inputs and output for an unstake transaction', async () => {
291291
const builder = new UnstakeBuilder(config).material(material);
292292
builder.from(rawTx.unstake.signed);
293293
builder
@@ -303,7 +303,7 @@ describe('Dot Transaction', () => {
303303
should(tx.outputs.length).eql(0);
304304
});
305305

306-
xit('should generate inputs and output for a withdraw staked transaction', async () => {
306+
it('should generate inputs and output for a withdraw staked transaction', async () => {
307307
const builder = new WithdrawUnstakedBuilder(config).material(material);
308308
builder.from(rawTx.withdrawUnbonded.signed);
309309
builder

modules/sdk-coin-dot/test/unit/transactionBuilder/addressInitializationBuilder.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ describe('Dot Address Initialization Builder', () => {
106106
should.deepEqual(txJson.eraPeriod, 64);
107107
});
108108

109-
xit('should build from raw signed tx', async () => {
109+
it('should build from raw signed tx', async () => {
110110
builder.from(rawTx.addProxy.signed);
111111
builder
112112
.validity({ firstValid: 3933, maxDuration: 64 })
@@ -128,7 +128,7 @@ describe('Dot Address Initialization Builder', () => {
128128
should.deepEqual(txJson.eraPeriod, 64);
129129
});
130130

131-
xit('should build from raw unsigned tx', async () => {
131+
it('should build from raw unsigned tx', async () => {
132132
builder.from(rawTx.addProxy.unsigned);
133133
builder
134134
.validity({ firstValid: 3933, maxDuration: 64 })
@@ -236,7 +236,7 @@ describe('Dot Address Initialization Builder', () => {
236236
should.deepEqual(txJson.eraPeriod, 64);
237237
});
238238

239-
xit('should build from raw signed tx', async () => {
239+
it('should build from raw signed tx', async () => {
240240
builder.from(rawTx.pureProxy.signed);
241241
builder
242242
.validity({ firstValid: 8975007, maxDuration: 64 })
@@ -249,15 +249,15 @@ describe('Dot Address Initialization Builder', () => {
249249
should.deepEqual(txJson.sender, sender.address);
250250
should.deepEqual(txJson.blockNumber, 8975007);
251251
should.deepEqual(txJson.referenceBlock, '0x9ed0c8ee5fdc375ee57f79591d7d0db4d7cd2aa0e5403a2ed84edf0f859e3f05');
252-
should.deepEqual(txJson.genesisHash, '0x67f9723393ef76214df0118c34bbbd3dbebc8ed46a10973a8c969d48fe7598c9');
252+
should.deepEqual(txJson.genesisHash, '0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e');
253253
should.deepEqual(txJson.nonce, 200);
254254
should.deepEqual(txJson.tip, 0);
255255
should.deepEqual(txJson.transactionVersion, txVersion);
256256
should.deepEqual(txJson.chainName, chainName);
257257
should.deepEqual(txJson.eraPeriod, 64);
258258
});
259259

260-
xit('should build from raw unsigned tx', async () => {
260+
it('should build from raw unsigned tx', async () => {
261261
builder.from(rawTx.pureProxy.unsigned);
262262
builder
263263
.validity({ firstValid: 8975007, maxDuration: 64 })
@@ -272,7 +272,7 @@ describe('Dot Address Initialization Builder', () => {
272272
should.deepEqual(txJson.sender, sender.address);
273273
should.deepEqual(txJson.blockNumber, 8975007);
274274
should.deepEqual(txJson.referenceBlock, '0x9ed0c8ee5fdc375ee57f79591d7d0db4d7cd2aa0e5403a2ed84edf0f859e3f05');
275-
should.deepEqual(txJson.genesisHash, '0x67f9723393ef76214df0118c34bbbd3dbebc8ed46a10973a8c969d48fe7598c9');
275+
should.deepEqual(txJson.genesisHash, '0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e');
276276
should.deepEqual(txJson.nonce, 200);
277277
should.deepEqual(txJson.tip, 0);
278278
should.deepEqual(txJson.transactionVersion, txVersion);

modules/sdk-coin-dot/test/unit/transactionBuilder/base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,15 @@ describe('Dot Transfer Builder Base', () => {
154154
should.deepEqual(material.chainName, chainName);
155155
});
156156

157-
xit('should build from raw signed tx', async () => {
157+
it('should build from raw signed tx', async () => {
158158
builder.from(rawTx.transfer.signed);
159159
should.deepEqual(builder.getSender(), sender.address);
160160
should.deepEqual(builder.getNonce(), 200);
161161
should.deepEqual(builder.getEraPeriod(), 64);
162162
should.deepEqual(builder.getTip(), undefined);
163163
});
164164

165-
xit('should build from raw unsigned tx', async () => {
165+
it('should build from raw unsigned tx', async () => {
166166
builder.from(rawTx.transfer.unsigned);
167167
should.deepEqual(
168168
builder.getReferenceBlock(),

0 commit comments

Comments
 (0)