Skip to content

Commit

Permalink
style: prettier updates
Browse files Browse the repository at this point in the history
  • Loading branch information
PacificYield committed Nov 22, 2024
1 parent 04a4193 commit c9eff27
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 82 deletions.
49 changes: 18 additions & 31 deletions test/encryptedERC20/EncryptedERC20.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,9 @@ describe("EncryptedERC20", function () {

const tx = await this.encryptedERC20
.connect(this.signers.alice)
["approve(address,bytes32,bytes)"](
this.signers.bob.address,
encryptedAllowanceAmount.handles[0],
encryptedAllowanceAmount.inputProof,
);
[
"approve(address,bytes32,bytes)"
](this.signers.bob.address, encryptedAllowanceAmount.handles[0], encryptedAllowanceAmount.inputProof);

await tx.wait();

Expand Down Expand Up @@ -284,11 +282,9 @@ describe("EncryptedERC20", function () {
await expect(
this.encryptedERC20
.connect(this.signers.alice)
["transfer(address,bytes32,bytes)"](
NULL_ADDRESS,
encryptedTransferAmount.handles[0],
encryptedTransferAmount.inputProof,
),
[
"transfer(address,bytes32,bytes)"
](NULL_ADDRESS, encryptedTransferAmount.handles[0], encryptedTransferAmount.inputProof),
).to.be.revertedWithCustomError(this.encryptedERC20, "ReceiverAddressNull");
});

Expand All @@ -304,11 +300,9 @@ describe("EncryptedERC20", function () {

tx = await this.encryptedERC20
.connect(this.signers.alice)
["transfer(address,bytes32,bytes)"](
this.signers.carol.address,
encryptedTransferAmount.handles[0],
encryptedTransferAmount.inputProof,
);
[
"transfer(address,bytes32,bytes)"
](this.signers.carol.address, encryptedTransferAmount.handles[0], encryptedTransferAmount.inputProof);

await tx.wait();

Expand All @@ -332,24 +326,19 @@ describe("EncryptedERC20", function () {

tx = await this.encryptedERC20
.connect(this.signers.alice)
["approve(address,bytes32,bytes)"](
this.signers.carol.address,
encryptedAllowanceAmount.handles[0],
encryptedAllowanceAmount.inputProof,
);
[
"approve(address,bytes32,bytes)"
](this.signers.carol.address, encryptedAllowanceAmount.handles[0], encryptedAllowanceAmount.inputProof);

input = this.instances.carol.createEncryptedInput(this.encryptedERC20Address, this.signers.carol.address);
input.add64(transferAmount);
const encryptedTransferAmount = await input.encrypt();

tx = await this.encryptedERC20
.connect(this.signers.carol)
["transferFrom(address,address,bytes32,bytes)"](
this.signers.alice.address,
this.signers.carol.address,
encryptedTransferAmount.handles[0],
encryptedTransferAmount.inputProof,
);
[
"transferFrom(address,address,bytes32,bytes)"
](this.signers.alice.address, this.signers.carol.address, encryptedTransferAmount.handles[0], encryptedTransferAmount.inputProof);

const allowanceHandleAlice = await this.encryptedERC20.allowance(
this.signers.alice.address,
Expand All @@ -371,11 +360,9 @@ describe("EncryptedERC20", function () {

const tx = await this.encryptedERC20
.connect(this.signers.alice)
["approve(address,bytes32,bytes)"](
this.signers.carol.address,
encryptedAllowanceAmount.handles[0],
encryptedAllowanceAmount.inputProof,
);
[
"approve(address,bytes32,bytes)"
](this.signers.carol.address, encryptedAllowanceAmount.handles[0], encryptedAllowanceAmount.inputProof);

await tx.wait();

Expand Down
65 changes: 24 additions & 41 deletions test/encryptedERC20/EncryptedERC20WithErrors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,9 @@ describe("EncryptedERC20WithErrors", function () {

tx = await this.encryptedERC20
.connect(this.signers.alice)
["transfer(address,bytes32,bytes)"](
this.signers.bob.address,
encryptedTransferAmount.handles[0],
encryptedTransferAmount.inputProof,
);
[
"transfer(address,bytes32,bytes)"
](this.signers.bob.address, encryptedTransferAmount.handles[0], encryptedTransferAmount.inputProof);

await tx.wait();

Expand Down Expand Up @@ -268,11 +266,9 @@ describe("EncryptedERC20WithErrors", function () {

const tx = await this.encryptedERC20
.connect(this.signers.alice)
["approve(address,bytes32,bytes)"](
this.signers.bob.address,
encryptedAllowanceAmount.handles[0],
encryptedAllowanceAmount.inputProof,
);
[
"approve(address,bytes32,bytes)"
](this.signers.bob.address, encryptedAllowanceAmount.handles[0], encryptedAllowanceAmount.inputProof);

await tx.wait();

Expand Down Expand Up @@ -351,11 +347,9 @@ describe("EncryptedERC20WithErrors", function () {
await expect(
this.encryptedERC20
.connect(this.signers.alice)
["transfer(address,bytes32,bytes)"](
NULL_ADDRESS,
encryptedTransferAmount.handles[0],
encryptedTransferAmount.inputProof,
),
[
"transfer(address,bytes32,bytes)"
](NULL_ADDRESS, encryptedTransferAmount.handles[0], encryptedTransferAmount.inputProof),
).to.be.revertedWithCustomError(this.encryptedERC20, "ReceiverAddressNull");
});

Expand All @@ -371,11 +365,9 @@ describe("EncryptedERC20WithErrors", function () {

tx = await this.encryptedERC20
.connect(this.signers.alice)
["transfer(address,bytes32,bytes)"](
this.signers.carol.address,
encryptedTransferAmount.handles[0],
encryptedTransferAmount.inputProof,
);
[
"transfer(address,bytes32,bytes)"
](this.signers.carol.address, encryptedTransferAmount.handles[0], encryptedTransferAmount.inputProof);

await tx.wait();

Expand All @@ -399,24 +391,19 @@ describe("EncryptedERC20WithErrors", function () {

tx = await this.encryptedERC20
.connect(this.signers.alice)
["approve(address,bytes32,bytes)"](
this.signers.carol.address,
encryptedAllowanceAmount.handles[0],
encryptedAllowanceAmount.inputProof,
);
[
"approve(address,bytes32,bytes)"
](this.signers.carol.address, encryptedAllowanceAmount.handles[0], encryptedAllowanceAmount.inputProof);

input = this.instances.carol.createEncryptedInput(this.encryptedERC20Address, this.signers.carol.address);
input.add64(transferAmount);
const encryptedTransferAmount = await input.encrypt();

tx = await this.encryptedERC20
.connect(this.signers.carol)
["transferFrom(address,address,bytes32,bytes)"](
this.signers.alice.address,
this.signers.carol.address,
encryptedTransferAmount.handles[0],
encryptedTransferAmount.inputProof,
);
[
"transferFrom(address,address,bytes32,bytes)"
](this.signers.alice.address, this.signers.carol.address, encryptedTransferAmount.handles[0], encryptedTransferAmount.inputProof);

const allowanceHandleAlice = await this.encryptedERC20.allowance(
this.signers.alice.address,
Expand All @@ -442,11 +429,9 @@ describe("EncryptedERC20WithErrors", function () {

tx = await this.encryptedERC20
.connect(this.signers.alice)
["transfer(address,bytes32,bytes)"](
this.signers.bob.address,
encryptedTransferAmount.handles[0],
encryptedTransferAmount.inputProof,
);
[
"transfer(address,bytes32,bytes)"
](this.signers.bob.address, encryptedTransferAmount.handles[0], encryptedTransferAmount.inputProof);

const errorCodeHandle = await this.encryptedERC20.getErrorCodeForTransferId(DEFAULT_TRANSFER_ID);

Expand Down Expand Up @@ -485,11 +470,9 @@ describe("EncryptedERC20WithErrors", function () {

const tx = await this.encryptedERC20
.connect(this.signers.alice)
["approve(address,bytes32,bytes)"](
this.signers.carol.address,
encryptedAllowanceAmount.handles[0],
encryptedAllowanceAmount.inputProof,
);
[
"approve(address,bytes32,bytes)"
](this.signers.carol.address, encryptedAllowanceAmount.handles[0], encryptedAllowanceAmount.inputProof);

await tx.wait();

Expand Down
8 changes: 3 additions & 5 deletions test/governance/Comp.fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ export async function transferTokensAndDelegate(

let tx = await comp
.connect(signers.alice)
["transfer(address,bytes32,bytes)"](
signers[account as keyof Signers],
encryptedTransferAmount.handles[0],
encryptedTransferAmount.inputProof,
);
[
"transfer(address,bytes32,bytes)"
](signers[account as keyof Signers], encryptedTransferAmount.handles[0], encryptedTransferAmount.inputProof);
await tx.wait();

tx = await comp.connect(signers[account as keyof Signers]).delegate(signers[delegate as keyof Signers].address);
Expand Down
8 changes: 3 additions & 5 deletions test/governance/Comp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,9 @@ describe("Comp", function () {

tx = await this.comp
.connect(this.signers.alice)
["transfer(address,bytes32,bytes)"](
this.signers.bob.address,
encryptedTransferAmount.handles[0],
encryptedTransferAmount.inputProof,
);
[
"transfer(address,bytes32,bytes)"
](this.signers.bob.address, encryptedTransferAmount.handles[0], encryptedTransferAmount.inputProof);

await tx.wait();

Expand Down

0 comments on commit c9eff27

Please sign in to comment.