git.delta.rocks / unique-network / refs/commits / f4c09d673ad5

difftreelog

sending fees to treasury + integration test

Greg Zaitsev2020-12-21parent: #feee462.patch.diff
in: master

5 files changed

modifiedruntime/src/lib.rsdiffbeforeafterboth
315 type Balance = Balance;315 type Balance = Balance;
316 /// The ubiquitous event type.316 /// The ubiquitous event type.
317 type Event = Event;317 type Event = Event;
318 type DustRemoval = ();318 type DustRemoval = Treasury;
319 type ExistentialDeposit = ExistentialDeposit;319 type ExistentialDeposit = ExistentialDeposit;
320 type AccountStore = System;320 type AccountStore = System;
321 type WeightInfo = ();321 type WeightInfo = ();
357357
358impl pallet_transaction_payment::Trait for Runtime {358impl pallet_transaction_payment::Trait for Runtime {
359 type Currency = pallet_balances::Module<Runtime>;359 type Currency = pallet_balances::Module<Runtime>;
360 type OnTransactionPayment = ();360 type OnTransactionPayment = Treasury;
361 type TransactionByteFee = TransactionByteFee;361 type TransactionByteFee = TransactionByteFee;
362 type WeightToFee = IdentityFee<Balance>;362 type WeightToFee = IdentityFee<Balance>;
363 type FeeMultiplierUpdate = ();363 type FeeMultiplierUpdate = ();
modifiedtests/package-lock.jsondiffbeforeafterboth
13 "@polkadot/api-contract": "^2.3.1",13 "@polkadot/api-contract": "^2.3.1",
14 "@polkadot/types": "^2.3.1",14 "@polkadot/types": "^2.3.1",
15 "@polkadot/util": "^3.4.1",15 "@polkadot/util": "^3.4.1",
16 "@types/bn.js": "^4.11.6",16 "bignumber.js": "^9.0.0",
17 "chai-as-promised": "^7.1.1"17 "chai-as-promised": "^7.1.1"
18 },18 },
19 "devDependencies": {19 "devDependencies": {
20 "@polkadot/dev": "^0.52.11",20 "@polkadot/dev": "^0.52.11",
21 "@polkadot/ts": "^0.3.41",21 "@polkadot/ts": "^0.3.41",
22 "@types/bn.js": "^4.11.6",
23 "@types/chai": "^4.2.12",22 "@types/chai": "^4.2.12",
24 "@types/chai-as-promised": "^7.1.3",23 "@types/chai-as-promised": "^7.1.3",
25 "@types/mocha": "^8.0.3",24 "@types/mocha": "^8.0.3",
7114 "node": "*"7113 "node": "*"
7115 }7114 }
7116 },7115 },
7116 "node_modules/bignumber.js": {
7117 "version": "9.0.1",
7118 "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz",
7119 "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA==",
7120 "engines": {
7121 "node": "*"
7122 }
7123 },
7117 "node_modules/binary-extensions": {7124 "node_modules/binary-extensions": {
7118 "version": "1.13.1",7125 "version": "1.13.1",
7119 "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz",7126 "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz",
34959 "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",34966 "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
34960 "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",34967 "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
34961 "dev": true34968 "dev": true
34969 },
34970 "bignumber.js": {
34971 "version": "9.0.1",
34972 "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz",
34973 "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA=="
34962 },34974 },
34963 "binary-extensions": {34975 "binary-extensions": {
34964 "version": "1.13.1",34976 "version": "1.13.1",
modifiedtests/package.jsondiffbeforeafterboth
6 "devDependencies": {6 "devDependencies": {
7 "@polkadot/dev": "^0.52.11",7 "@polkadot/dev": "^0.52.11",
8 "@polkadot/ts": "^0.3.41",8 "@polkadot/ts": "^0.3.41",
9 "@types/bn.js": "^4.11.6",
10 "@types/chai": "^4.2.12",9 "@types/chai": "^4.2.12",
11 "@types/chai-as-promised": "^7.1.3",10 "@types/chai-as-promised": "^7.1.3",
12 "@types/mocha": "^8.0.3",11 "@types/mocha": "^8.0.3",
27 "@polkadot/api-contract": "^2.3.1",26 "@polkadot/api-contract": "^2.3.1",
28 "@polkadot/types": "^2.3.1",27 "@polkadot/types": "^2.3.1",
29 "@polkadot/util": "^3.4.1",28 "@polkadot/util": "^3.4.1",
30 "@types/bn.js": "^4.11.6",29 "bignumber.js": "^9.0.0",
31 "chai-as-promised": "^7.1.1"30 "chai-as-promised": "^7.1.1"
32 },31 },
33 "standard": {32 "standard": {
addedtests/src/crefitFeesToTreasury.test.tsdiffbeforeafterboth

no changes

modifiedtests/src/util/helpers.tsdiffbeforeafterboth
9chai.use(chaiAsPromised);9chai.use(chaiAsPromised);
10const expect = chai.expect;10const expect = chai.expect;
11
12type GenericResult = {
13 success: boolean,
14};
1115
12type CreateCollectionResult = {16type CreateCollectionResult = {
13 success: boolean,17 success: boolean,
14 collectionId: number18 collectionId: number
15};19};
20
21export function getGenericResult(events: EventRecord[]): GenericResult {
22 let result: GenericResult = {
23 success: false
24 }
25 events.forEach(({ phase, event: { data, method, section } }) => {
26 // console.log(` ${phase}: ${section}.${method}:: ${data}`);
27 if (method == 'ExtrinsicSuccess') {
28 result.success = true;
29 }
30 });
31 return result;
32}
1633
17function getCreateCollectionResult(events: EventRecord[]): CreateCollectionResult {34function getCreateCollectionResult(events: EventRecord[]): CreateCollectionResult {
18 let success = false;35 let success = false;