Skip to content

Commit 9397d2e

Browse files
committed
Added #152 removed levy
1 parent b9a880d commit 9397d2e

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
@@ -75,7 +75,6 @@ describe('MosaicHttp', () => {
7575
MosaicProperties.create({
7676
supplyMutable: true,
7777
transferable: true,
78-
levyMutable: true,
7978
divisibility: 3,
8079
}),
8180
NetworkType.MIJIN_TEST,
@@ -163,7 +162,6 @@ describe('MosaicHttp', () => {
163162
expect(mosaicInfo.divisibility).to.be.equal(3);
164163
expect(mosaicInfo.isSupplyMutable()).to.be.equal(true);
165164
expect(mosaicInfo.isTransferable()).to.be.equal(true);
166-
expect(mosaicInfo.isLevyMutable()).to.be.equal(true);
167165
done();
168166
});
169167
});
@@ -177,7 +175,6 @@ describe('MosaicHttp', () => {
177175
expect(mosaicInfos[0].divisibility).to.be.equal(3);
178176
expect(mosaicInfos[0].isSupplyMutable()).to.be.equal(true);
179177
expect(mosaicInfos[0].isTransferable()).to.be.equal(true);
180-
expect(mosaicInfos[0].isLevyMutable()).to.be.equal(true);
181178
done();
182179
});
183180
});
@@ -191,7 +188,6 @@ describe('MosaicHttp', () => {
191188
expect(mosaicInfos[0].divisibility).to.be.equal(3);
192189
expect(mosaicInfos[0].isSupplyMutable()).to.be.equal(true);
193190
expect(mosaicInfos[0].isTransferable()).to.be.equal(true);
194-
expect(mosaicInfos[0].isLevyMutable()).to.be.equal(true);
195191
done();
196192
});
197193
});

e2e/infrastructure/TransactionHttp.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ describe('TransactionHttp', () => {
138138
MosaicProperties.create({
139139
supplyMutable: true,
140140
transferable: true,
141-
levyMutable: true,
142141
divisibility: 3,
143142
}),
144143
NetworkType.MIJIN_TEST,
@@ -173,7 +172,6 @@ describe('TransactionHttp', () => {
173172
MosaicProperties.create({
174173
supplyMutable: true,
175174
transferable: true,
176-
levyMutable: true,
177175
divisibility: 3,
178176
}),
179177
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)