Skip to content

Commit

Permalink
prettify
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelcabot committed Sep 27, 2022
1 parent 6fec018 commit 8775cb5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 38 deletions.
4 changes: 1 addition & 3 deletions deploy/SoulStore.ts
Expand Up @@ -131,9 +131,7 @@ const func: DeployFunction = async ({
await soulStore
.connect(signer)
.setNameRegistrationPricePerYear(3, 1500000000); // 3 length, 1,500 USDC
await soulStore
.connect(signer)
.setNameRegistrationPricePerYear(4, 500000000); // 4 length, 500 USDC
await soulStore.connect(signer).setNameRegistrationPricePerYear(4, 500000000); // 4 length, 500 USDC

// we add soulStore as soulboundIdentity and soulName minter

Expand Down
47 changes: 12 additions & 35 deletions test/SoulStore.test.ts
Expand Up @@ -51,9 +51,7 @@ describe("Soul Store", () => {
await deployments.fixture("SoulStore", { fallbackToGlobal: false });

const { address: cornAddress } = await deployments.get("CORN");
const { address: soulStoreAddress } = await deployments.get(
"SoulStore"
);
const { address: soulStoreAddress } = await deployments.get("SoulStore");

soulStore = SoulStore__factory.connect(soulStoreAddress, owner);
const uniswapRouter: IUniswapRouter = IUniswapRouter__factory.connect(
Expand Down Expand Up @@ -122,9 +120,7 @@ describe("Soul Store", () => {
it("should set SoulboundIdentity from admin", async () => {
await soulStore.connect(owner).setSoulboundIdentity(address1.address);

expect(await soulStore.soulboundIdentity()).to.be.equal(
address1.address
);
expect(await soulStore.soulboundIdentity()).to.be.equal(address1.address);
});

it("should fail to set SoulboundIdentity from non admin", async () => {
Expand All @@ -147,9 +143,7 @@ describe("Soul Store", () => {
it("should fail to set MintingNamePrice from non admin", async () => {
const newPrice = 100;
await expect(
soulStore
.connect(address1)
.setNameRegistrationPricePerYear(0, newPrice)
soulStore.connect(address1).setNameRegistrationPricePerYear(0, newPrice)
).to.be.rejected;
});

Expand All @@ -160,9 +154,8 @@ describe("Soul Store", () => {
});

it("should fail to set StableCoin from non admin", async () => {
await expect(
soulStore.connect(address1).setStableCoin(address1.address)
).to.be.rejected;
await expect(soulStore.connect(address1).setStableCoin(address1.address))
.to.be.rejected;
});

it("should set UtilityToken from admin", async () => {
Expand Down Expand Up @@ -196,9 +189,8 @@ describe("Soul Store", () => {
});

it("should fail to set SwapRouter from non admin", async () => {
await expect(
soulStore.connect(address1).setSwapRouter(address1.address)
).to.be.rejected;
await expect(soulStore.connect(address1).setSwapRouter(address1.address))
.to.be.rejected;
});

it("should set WrappedNativeToken from admin", async () => {
Expand Down Expand Up @@ -308,10 +300,7 @@ describe("Soul Store", () => {

describe("purchase identity and name", () => {
it("we can purchase an identity and name with ETH", async () => {
const [, priceInETH] = await soulStore.purchaseNameInfo(
SOUL_NAME,
YEAR
);
const [, priceInETH] = await soulStore.purchaseNameInfo(SOUL_NAME, YEAR);

await soulStore.connect(address1).purchaseIdentityAndName(
ethers.constants.AddressZero, // ETH
Expand Down Expand Up @@ -360,10 +349,7 @@ describe("Soul Store", () => {
});

it("we can't purchase an identity and name with ETH if we pay less", async () => {
const [, priceInETH] = await soulStore.purchaseNameInfo(
SOUL_NAME,
YEAR
);
const [, priceInETH] = await soulStore.purchaseNameInfo(SOUL_NAME, YEAR);

await expect(
soulStore.connect(address1).purchaseIdentityAndName(
Expand Down Expand Up @@ -418,10 +404,7 @@ describe("Soul Store", () => {
});

it("we can purchase an identity and name with more ETH receiving the refund", async () => {
const [, priceInETH] = await soulStore.purchaseNameInfo(
SOUL_NAME,
YEAR
);
const [, priceInETH] = await soulStore.purchaseNameInfo(SOUL_NAME, YEAR);

const balance = await address1.getBalance();

Expand Down Expand Up @@ -457,10 +440,7 @@ describe("Soul Store", () => {
});

it("we can purchase a name with ETH", async () => {
const [, priceInETH] = await soulStore.purchaseNameInfo(
SOUL_NAME,
YEAR
);
const [, priceInETH] = await soulStore.purchaseNameInfo(SOUL_NAME, YEAR);

await soulStore.connect(address1).purchaseName(
ethers.constants.AddressZero, // ETH
Expand Down Expand Up @@ -509,10 +489,7 @@ describe("Soul Store", () => {
});

it("we can't purchase a name with ETH if we pay less", async () => {
const [, priceInETH] = await soulStore.purchaseNameInfo(
SOUL_NAME,
YEAR
);
const [, priceInETH] = await soulStore.purchaseNameInfo(SOUL_NAME, YEAR);

await expect(
soulStore.connect(address1).purchaseName(
Expand Down

0 comments on commit 8775cb5

Please sign in to comment.