Skip to content

Commit 19dfa34

Browse files
committed
Added #152 removed levy
1 parent dc11483 commit 19dfa34

20 files changed

+8
-143
lines changed

e2e/infrastructure/MosaicHttp.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ describe('MosaicHttp', () => {
7777
MosaicProperties.create({
7878
supplyMutable: true,
7979
transferable: true,
80-
levyMutable: true,
8180
divisibility: 3,
8281
}),
8382
NetworkType.MIJIN_TEST,
@@ -165,7 +164,6 @@ describe('MosaicHttp', () => {
165164
expect(mosaicInfo.divisibility).to.be.equal(3);
166165
expect(mosaicInfo.isSupplyMutable()).to.be.equal(true);
167166
expect(mosaicInfo.isTransferable()).to.be.equal(true);
168-
expect(mosaicInfo.isLevyMutable()).to.be.equal(true);
169167
done();
170168
});
171169
});
@@ -179,7 +177,6 @@ describe('MosaicHttp', () => {
179177
expect(mosaicInfos[0].divisibility).to.be.equal(3);
180178
expect(mosaicInfos[0].isSupplyMutable()).to.be.equal(true);
181179
expect(mosaicInfos[0].isTransferable()).to.be.equal(true);
182-
expect(mosaicInfos[0].isLevyMutable()).to.be.equal(true);
183180
done();
184181
});
185182
});
@@ -193,7 +190,6 @@ describe('MosaicHttp', () => {
193190
expect(mosaicInfos[0].divisibility).to.be.equal(3);
194191
expect(mosaicInfos[0].isSupplyMutable()).to.be.equal(true);
195192
expect(mosaicInfos[0].isTransferable()).to.be.equal(true);
196-
expect(mosaicInfos[0].isLevyMutable()).to.be.equal(true);
197193
done();
198194
});
199195
});

e2e/infrastructure/TransactionHttp.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ describe('TransactionHttp', () => {
139139
MosaicProperties.create({
140140
supplyMutable: true,
141141
transferable: true,
142-
levyMutable: true,
143142
divisibility: 3,
144143
}),
145144
NetworkType.MIJIN_TEST,
@@ -174,7 +173,6 @@ describe('TransactionHttp', () => {
174173
MosaicProperties.create({
175174
supplyMutable: true,
176175
transferable: true,
177-
levyMutable: true,
178176
divisibility: 3,
179177
}),
180178
NetworkType.MIJIN_TEST,

e2e/infrastructure/transaction/ValidateTransaction.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ const ValidateTransaction = {
108108
.to.be.equal(true);
109109
expect(mosaicDefinitionTransaction.mosaicProperties.transferable)
110110
.to.be.equal(true);
111-
expect(mosaicDefinitionTransaction.mosaicProperties.levyMutable)
112-
.to.be.equal(true);
113111
},
114112
validateMosaicSupplyChangeTx: (mosaicSupplyChangeTransaction, mosaicSupplyChangeTransactionDTO) => {
115113
deepEqual(mosaicSupplyChangeTransaction.mosaicId,

src/infrastructure/MosaicHttp.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ export class MosaicHttp extends Http implements MosaicRepository {
7272
(new UInt64(mosaicInfoDTO.mosaic.properties[1])).compact(),
7373
new UInt64(mosaicInfoDTO.mosaic.properties[2]),
7474
),
75-
mosaicInfoDTO.mosaic.levy,
7675
);
7776
}))));
7877
}
@@ -102,7 +101,6 @@ export class MosaicHttp extends Http implements MosaicRepository {
102101
(new UInt64(mosaicInfoDTO.mosaic.properties[1])).compact(),
103102
new UInt64(mosaicInfoDTO.mosaic.properties[2]),
104103
),
105-
mosaicInfoDTO.mosaic.levy,
106104
);
107105
});
108106
}))));

src/infrastructure/transaction/CreateTransactionFromPayload.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ const CreateTransaction = (type: number, transactionData: string, networkType: N
224224
MosaicProperties.create({
225225
supplyMutable: (flags & 1) === 1,
226226
transferable: (flags & 2) === 2,
227-
levyMutable: (flags & 4) === 4,
228227
divisibility: parseInt(convert.uint8ToHex(convert.hexToUint8(divisibility).reverse()), 16),
229228
duration: duration ? UInt64.fromHex(reverse(duration)) : undefined,
230229
}),

src/model/mosaic/MosaicInfo.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export class MosaicInfo {
3333
* @param height
3434
* @param owner
3535
* @param properties
36-
* @param levy
3736
*/
3837
constructor(/**
3938
* The meta data id.
@@ -63,10 +62,7 @@ export class MosaicInfo {
6362
* The mosaic properties.
6463
*/
6564
private readonly properties: MosaicProperties,
66-
/**
67-
* The optional levy for the mosaic. A creator can demand that each mosaic transfer induces an additional fee.
68-
*/
69-
public readonly levy: any) {
65+
) {
7066
}
7167

7268
/**
@@ -100,13 +96,4 @@ export class MosaicInfo {
10096
public isTransferable(): boolean {
10197
return this.properties.transferable;
10298
}
103-
104-
/**
105-
* Is levy mutable
106-
* @returns {boolean}
107-
*/
108-
public isLevyMutable(): boolean {
109-
return this.properties.levyMutable;
110-
}
111-
11299
}

src/model/mosaic/MosaicProperties.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ export class MosaicProperties {
3636
*/
3737
public readonly transferable: boolean;
3838

39-
/**
40-
* Levy mutable
41-
*/
42-
public readonly levyMutable: boolean;
43-
4439
/**
4540
* @param flags
4641
* @param divisibility
@@ -63,10 +58,9 @@ export class MosaicProperties {
6358
*/
6459
public readonly duration?: UInt64) {
6560
let binaryFlags = '00' + (flags.lower >>> 0).toString(2);
66-
binaryFlags = binaryFlags.substr(binaryFlags.length - 3, 3);
67-
this.supplyMutable = binaryFlags[2] === '1';
68-
this.transferable = binaryFlags[1] === '1';
69-
this.levyMutable = binaryFlags[0] === '1';
61+
binaryFlags = binaryFlags.substr(binaryFlags.length - 2, 2);
62+
this.supplyMutable = binaryFlags[1] === '1';
63+
this.transferable = binaryFlags[0] === '1';
7064
}
7165

7266
/**
@@ -77,11 +71,10 @@ export class MosaicProperties {
7771
public static create(params: {
7872
supplyMutable: boolean,
7973
transferable: boolean,
80-
levyMutable: boolean,
8174
divisibility: number,
8275
duration?: UInt64,
8376
}) {
84-
const flags = (params.supplyMutable ? 1 : 0) + (params.transferable ? 2 : 0) + (params.levyMutable ? 4 : 0);
77+
const flags = (params.supplyMutable ? 1 : 0) + (params.transferable ? 2 : 0);
8578
return new MosaicProperties(UInt64.fromUint(flags), params.divisibility, params.duration);
8679
}
8780

@@ -91,8 +84,7 @@ export class MosaicProperties {
9184
toDTO() {
9285
const dto = [
9386
{id: 0, value: UInt64.fromUint((this.supplyMutable ? 1 : 0) +
94-
(this.transferable ? 2 : 0) +
95-
(this.levyMutable ? 4 : 0)).toDTO()},
87+
(this.transferable ? 2 : 0)).toDTO()},
9688
{id: 1, value: UInt64.fromUint(this.divisibility).toDTO()},
9789
];
9890

src/model/mosaic/NetworkCurrencyMosaic.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
import {convert, mosaicId as MosaicIdGenerator} from 'nem2-library';
18-
import {PublicAccount} from '../account/PublicAccount';
1917
import {NamespaceId} from '../namespace/NamespaceId';
2018
import {UInt64} from '../UInt64';
2119
import {Mosaic} from './Mosaic';
@@ -62,12 +60,6 @@ export class NetworkCurrencyMosaic extends Mosaic {
6260
*/
6361
public static SUPPLY_MUTABLE = false;
6462

65-
/**
66-
* Is Levy mutable
67-
* @type {boolean}
68-
*/
69-
public static LEVY_MUTABLE = false;
70-
7163
/**
7264
* constructor
7365
* @param owner

src/model/mosaic/NetworkHarvestMosaic.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ export class NetworkHarvestMosaic extends Mosaic {
6262
*/
6363
public static SUPPLY_MUTABLE = true;
6464

65-
/**
66-
* Is Levy mutable
67-
* @type {boolean}
68-
*/
69-
public static LEVY_MUTABLE = false;
70-
7165
/**
7266
* constructor
7367
* @param owner

src/model/transaction/MosaicDefinitionTransaction.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@ export class MosaicDefinitionTransaction extends Transaction {
140140
mosaicDefinitionTransaction = mosaicDefinitionTransaction.addTransferability();
141141
}
142142

143-
if (this.mosaicProperties.levyMutable === true) {
144-
mosaicDefinitionTransaction = mosaicDefinitionTransaction.addLevyMutable();
145-
}
146-
147143
return mosaicDefinitionTransaction.build();
148144
}
149145

0 commit comments

Comments
 (0)