Skip to content

Commit a60170a

Browse files
committed
ran yarn format
1 parent 0d9397a commit a60170a

File tree

3 files changed

+53
-30
lines changed

3 files changed

+53
-30
lines changed

contracts/_interfaces/IXCAmple.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import "uFragments/contracts/interfaces/IAMPL.sol";
55

66
interface IXCAmple is IAMPL {
77
function globalAMPLSupply() external view returns (uint256);
8+
89
function mint(address who, uint256 xcAmpleAmount) external;
10+
911
function burnFrom(address who, uint256 xcAmpleAmount) external;
1012
}

test/integration/chain_bridge.js

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ async function execXCSend (
248248
amount,
249249
setApproval = true,
250250
) {
251-
252251
if (setApproval) {
253252
if (fromChain === 'base') {
254253
await baseChainAmplContracts.ampl
@@ -733,7 +732,7 @@ describe('Transfers scenarios', function () {
733732
);
734733
});
735734

736-
describe('user does not approve Vault on base chain', function() {
735+
describe('user does not approve Vault on base chain', function () {
737736
it('should revert', async function () {
738737
await checkBalancesAndSupply(
739738
['100000', '100000'],
@@ -743,12 +742,10 @@ describe('Transfers scenarios', function () {
743742
'0',
744743
);
745744

746-
await baseChainAmplContracts.ampl
747-
.connect(userBBaseChainWallet)
748-
.approve(
749-
bridgeContractsMap['base'].tokenVault.address,
750-
toAmplFixedPt('0'), // Approve 0
751-
);
745+
await baseChainAmplContracts.ampl.connect(userBBaseChainWallet).approve(
746+
bridgeContractsMap['base'].tokenVault.address,
747+
toAmplFixedPt('0'), // Approve 0
748+
);
752749

753750
await expect(
754751
execXCSend(
@@ -757,15 +754,14 @@ describe('Transfers scenarios', function () {
757754
userBBaseChainWallet,
758755
userBSatChain1Wallet,
759756
toAmplFixedPt('5000'),
760-
false, // Use existing approval and don't auto-approve.
757+
false, // Use existing approval and don't auto-approve.
761758
),
762759
).to.be.reverted;
763-
})
760+
});
764761
});
765762

766-
describe('user does not approve Controller on satellite chain', function() {
763+
describe('user does not approve Controller on satellite chain', function () {
767764
it('should revert', async function () {
768-
769765
// Setup by placing amples on satellite chain
770766
await checkBalancesAndSupply(
771767
['100000', '100000'],
@@ -794,7 +790,7 @@ describe('Transfers scenarios', function () {
794790
.connect(userASatChain1Wallet)
795791
.approve(
796792
amplContractsMap['sat1'].xcAmpleController.address,
797-
toAmplFixedPt('0'), // Approve 0
793+
toAmplFixedPt('0'), // Approve 0
798794
);
799795
await expect(
800796
execXCSend(
@@ -803,7 +799,7 @@ describe('Transfers scenarios', function () {
803799
userASatChain1Wallet,
804800
userABaseChainWallet,
805801
toAmplFixedPt('1'),
806-
false, // Use existing approval and don't auto-approve.
802+
false, // Use existing approval and don't auto-approve.
807803
),
808804
).to.be.reverted;
809805
});

test/unit/satellite-chain/xc-ampleforth/xc_ample_burn.js

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,17 @@ describe('XCAmple:burnFrom:accessControl', function () {
4343

4444
it('should NOT be callable by other user', async function () {
4545
await expect(
46-
xcAmple.connect(otherUser).burnFrom(otherUser.getAddress(), unitTokenAmount),
46+
xcAmple
47+
.connect(otherUser)
48+
.burnFrom(otherUser.getAddress(), unitTokenAmount),
4749
).to.be.reverted;
4850
});
4951

5052
it('should be callable by spender', async function () {
5153
await expect(
52-
xcAmple.connect(deployer).burnFrom(otherUser.getAddress(), unitTokenAmount),
54+
xcAmple
55+
.connect(deployer)
56+
.burnFrom(otherUser.getAddress(), unitTokenAmount),
5357
).not.to.be.reverted;
5458
});
5559
});
@@ -60,9 +64,7 @@ describe('XCAmple:burnFrom', () => {
6064
describe('when burn address is zero address', () => {
6165
it('should revert', async function () {
6266
await expect(
63-
xcAmple
64-
.connect(deployer)
65-
.burnFrom(ethers.constants.AddressZero, 0),
67+
xcAmple.connect(deployer).burnFrom(ethers.constants.AddressZero, 0),
6668
).to.be.reverted;
6769
});
6870
});
@@ -72,7 +74,9 @@ describe('XCAmple:burnFrom', () => {
7274
const mintAmt = toUFrgDenomination('1000000');
7375
await xcAmple.connect(deployer).mint(otherUser.getAddress(), mintAmt);
7476
const burnAmt = (await xcAmple.balanceOf(otherUser.getAddress())).add(1);
75-
await xcAmple.connect(otherUser).approve(await deployer.getAddress(), burnAmt);
77+
await xcAmple
78+
.connect(otherUser)
79+
.approve(await deployer.getAddress(), burnAmt);
7680

7781
await expect(
7882
xcAmple.connect(deployer).burnFrom(otherUser.getAddress(), burnAmt),
@@ -84,7 +88,9 @@ describe('XCAmple:burnFrom', () => {
8488
it('should revert', async function () {
8589
const mintAmt = toUFrgDenomination('1000000');
8690
await xcAmple.connect(deployer).mint(otherUser.getAddress(), mintAmt);
87-
await xcAmple.connect(otherUser).approve(await deployer.getAddress(), mintAmt.sub(1));
91+
await xcAmple
92+
.connect(otherUser)
93+
.approve(await deployer.getAddress(), mintAmt.sub(1));
8894
await expect(
8995
xcAmple.connect(deployer).burnFrom(otherUser.getAddress(), mintAmt),
9096
).to.be.reverted;
@@ -98,7 +104,7 @@ describe('XCAmple:burnFrom', () => {
98104
beforeEach(async function () {
99105
await xcAmple.connect(deployer).mint(deployer.getAddress(), amt2);
100106
await xcAmple.connect(deployer).mint(otherUser.getAddress(), amt1);
101-
await xcAmple.connect(otherUser).approve(deployer.getAddress(), amt1)
107+
await xcAmple.connect(otherUser).approve(deployer.getAddress(), amt1);
102108
});
103109
it('should burn tokens from wallet', async function () {
104110
await xcAmple.connect(deployer).burnFrom(otherUser.getAddress(), amt1);
@@ -115,12 +121,19 @@ describe('XCAmple:burnFrom', () => {
115121
expect(await xcAmple.totalSupply()).to.eq(amt2);
116122
});
117123
it('should reduce the approved amount', async function () {
118-
const allowanceBefore = await xcAmple.allowance(otherUser.getAddress(), deployer.getAddress());
124+
const allowanceBefore = await xcAmple.allowance(
125+
otherUser.getAddress(),
126+
deployer.getAddress(),
127+
);
119128
await xcAmple.connect(deployer).burnFrom(otherUser.getAddress(), amt1);
120-
expect(await xcAmple.allowance(otherUser.getAddress(), deployer.getAddress())).to.eq(allowanceBefore - amt1);
129+
expect(
130+
await xcAmple.allowance(otherUser.getAddress(), deployer.getAddress()),
131+
).to.eq(allowanceBefore - amt1);
121132
});
122133
it('should log Transfer to zero address', async function () {
123-
await expect(xcAmple.connect(deployer).burnFrom(otherUser.getAddress(), amt1))
134+
await expect(
135+
xcAmple.connect(deployer).burnFrom(otherUser.getAddress(), amt1),
136+
)
124137
.to.emit(xcAmple, 'Transfer')
125138
.withArgs(
126139
await otherUser.getAddress(),
@@ -151,9 +164,14 @@ describe('XCAmple:burnFrom', () => {
151164
expect(await xcAmple.totalSupply()).to.eq(remainingBal);
152165
});
153166
it('should reduce the approved amount', async function () {
154-
const allowanceBefore = await xcAmple.allowance(otherUser.getAddress(), deployer.getAddress());
167+
const allowanceBefore = await xcAmple.allowance(
168+
otherUser.getAddress(),
169+
deployer.getAddress(),
170+
);
155171
await xcAmple.connect(deployer).burnFrom(otherUser.getAddress(), burnAmt);
156-
expect(await xcAmple.allowance(otherUser.getAddress(), deployer.getAddress())).to.eq(allowanceBefore - burnAmt);
172+
expect(
173+
await xcAmple.allowance(otherUser.getAddress(), deployer.getAddress()),
174+
).to.eq(allowanceBefore - burnAmt);
157175
});
158176
it('should log Transfer to zero address', async function () {
159177
await expect(
@@ -175,7 +193,9 @@ describe('XCAmple:burnFrom', () => {
175193
beforeEach(async function () {
176194
await xcAmple.rebase(1, MAX_SUPPLY);
177195
await xcAmple.connect(deployer).mint(otherUser.getAddress(), MAX_SUPPLY);
178-
await xcAmple.connect(otherUser).approve(deployer.getAddress(), MAX_SUPPLY);
196+
await xcAmple
197+
.connect(otherUser)
198+
.approve(deployer.getAddress(), MAX_SUPPLY);
179199
});
180200

181201
it('should burn tokens from wallet', async function () {
@@ -190,9 +210,14 @@ describe('XCAmple:burnFrom', () => {
190210
expect(await xcAmple.totalSupply()).to.eq(remainingBal);
191211
});
192212
it('should reduce the approved amount', async function () {
193-
const allowanceBefore = await xcAmple.allowance(otherUser.getAddress(), deployer.getAddress());
213+
const allowanceBefore = await xcAmple.allowance(
214+
otherUser.getAddress(),
215+
deployer.getAddress(),
216+
);
194217
await xcAmple.connect(deployer).burnFrom(otherUser.getAddress(), burnAmt);
195-
expect(await xcAmple.allowance(otherUser.getAddress(), deployer.getAddress())).to.eq(allowanceBefore.sub(burnAmt));
218+
expect(
219+
await xcAmple.allowance(otherUser.getAddress(), deployer.getAddress()),
220+
).to.eq(allowanceBefore.sub(burnAmt));
196221
});
197222
it('should log Transfer to zero address', async function () {
198223
await expect(

0 commit comments

Comments
 (0)