Skip to content

Commit f86a6a8

Browse files
author
Victor Wiebe
committed
fix: remove the changes made to ptm, prevent conflict with other pr
1 parent 2d50f1d commit f86a6a8

1 file changed

Lines changed: 8 additions & 36 deletions

File tree

src/procedures/__tests__/EnablePercentageTransferManager.ts

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable import/no-duplicates */
22
import { ImportMock, MockManager } from 'ts-mock-imports';
3-
import sinon, { stub, restore } from 'sinon';
4-
import { BigNumber, ModuleName } from '@polymathnetwork/contract-wrappers';
3+
import { spy, restore } from 'sinon';
4+
import { BigNumber } from '@polymathnetwork/contract-wrappers';
55
import * as contractWrappersModule from '@polymathnetwork/contract-wrappers';
66
import * as contextModule from '../../Context';
77
import * as wrappersModule from '../../PolymathBase';
@@ -64,71 +64,43 @@ describe('EnablePercentageTransferManager', () => {
6464

6565
describe('EnablePercentageTransferManager', () => {
6666
test('should add a transaction to the queue to enable percentage transfer manager', async () => {
67-
const addModuleWithLabelArgsSpy = sinon.spy();
68-
const addTransactionStub = stub(target, 'addTransaction');
67+
const addTransactionSpy = spy(target, 'addTransaction');
6968
securityTokenMock.mock('addModuleWithLabel', Promise.resolve('AddModuleWithLabel'));
70-
const { addModuleWithLabel } = securityTokenMock.getMockInstance();
71-
addTransactionStub.withArgs(addModuleWithLabel).returns(addModuleWithLabelArgsSpy);
7269

7370
// Real call
7471
await target.prepareTransactions();
7572

7673
// Verifications
77-
expect(addModuleWithLabelArgsSpy.getCall(0).args[0]).toEqual({
78-
moduleName: ModuleName.PercentageTransferManager,
79-
address: moduleFactoryAddress,
80-
archived: false,
81-
data: {
82-
allowPrimaryIssuance: false,
83-
maxHolderPercentage: params.maxHolderPercentage,
84-
},
85-
});
86-
expect(addModuleWithLabelArgsSpy.callCount).toEqual(1);
87-
8874
expect(
89-
addTransactionStub
75+
addTransactionSpy
9076
.getCall(0)
9177
.calledWithExactly(securityTokenMock.getMockInstance().addModuleWithLabel, {
9278
tag: PolyTransactionTag.EnablePercentageTransferManager,
9379
})
9480
).toEqual(true);
95-
expect(addTransactionStub.callCount).toEqual(1);
81+
expect(addTransactionSpy.callCount).toEqual(1);
9682
});
9783

9884
test('should add a transaction to the queue to enable percentage transfer manager with primary issuance', async () => {
9985
target = new EnablePercentageTransferManager(
10086
{ ...params, allowPrimaryIssuance: true },
10187
contextMock.getMockInstance()
10288
);
103-
const addModuleWithLabelArgsSpy = sinon.spy();
104-
const addTransactionStub = stub(target, 'addTransaction');
89+
const addTransactionSpy = spy(target, 'addTransaction');
10590
securityTokenMock.mock('addModuleWithLabel', Promise.resolve('AddModuleWithLabel'));
106-
const { addModuleWithLabel } = securityTokenMock.getMockInstance();
107-
addTransactionStub.withArgs(addModuleWithLabel).returns(addModuleWithLabelArgsSpy);
10891

10992
// Real call
11093
await target.prepareTransactions();
11194

11295
// Verifications
113-
expect(addModuleWithLabelArgsSpy.getCall(0).args[0]).toEqual({
114-
moduleName: ModuleName.PercentageTransferManager,
115-
address: moduleFactoryAddress,
116-
archived: false,
117-
data: {
118-
allowPrimaryIssuance: true,
119-
maxHolderPercentage: params.maxHolderPercentage,
120-
},
121-
});
122-
expect(addModuleWithLabelArgsSpy.callCount).toEqual(1);
123-
12496
expect(
125-
addTransactionStub
97+
addTransactionSpy
12698
.getCall(0)
12799
.calledWithExactly(securityTokenMock.getMockInstance().addModuleWithLabel, {
128100
tag: PolyTransactionTag.EnablePercentageTransferManager,
129101
})
130102
).toEqual(true);
131-
expect(addTransactionStub.callCount).toEqual(1);
103+
expect(addTransactionSpy.callCount).toEqual(1);
132104
});
133105

134106
test('should throw if there is no valid security token supplied', async () => {

0 commit comments

Comments
 (0)