Skip to content

Commit

Permalink
Merge pull request #66 from marcelomorgado/fix-synthetix-tests
Browse files Browse the repository at this point in the history
Fix synthetix tests
  • Loading branch information
adrianmcli authored Jun 24, 2020
2 parents 30c35d6 + 690ef8d commit 947177e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 43 deletions.
24 changes: 0 additions & 24 deletions docs/synthetix.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,30 +237,6 @@ test("issue 100 sUSD tokens", async () => {
});
```
### Shouldn't be able to transfer locked SNX tokens
```js
// ../tests/synthetix.test.ts#L148-L164

test("shouldn't be able to transfer locked SNX tokens", async () => {
// given
const snxBalance = await snxContract.balanceOf(wallet.address);
const snxBalanceInFloat = parseFloat(fromWei(snxBalance));

const transferableSnx = await synthetixContract.transferableSynthetix(
wallet.address,
);
const transferableSnxInFloat = parseFloat(fromWei(transferableSnx));

expect(transferableSnxInFloat).toBeLessThan(snxBalanceInFloat);

// when-then
await expect(
snxContract.transfer(someAccount, snxBalance),
).rejects.toThrow();
});
```
### Exchange from sUSD to sXAU
```js
Expand Down
2 changes: 1 addition & 1 deletion src/synthetix/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import DepotAbi from "./abi/Depot.json";
const contracts = {
Synthetix: {
abi: SynthetixAbi,
address: "0xC011A72400E58ecD99Ee497CF89E3775d4bd732F",
address: "0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f",
},
ExchangeRates: {
abi: ExchangeRatesAbi,
Expand Down
18 changes: 0 additions & 18 deletions tests/synthetix.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,24 +145,6 @@ describe("synthetix", () => {
expect(fromWei(sUSDAfter)).toBe(fromWei(sUSDToMintInWei));
});

test("shouldn't be able to transfer locked SNX tokens", async () => {
// given
const snxBalance = await snxContract.balanceOf(wallet.address);
const snxBalanceInFloat = parseFloat(fromWei(snxBalance));

const transferableSnx = await synthetixContract.transferableSynthetix(
wallet.address,
);
const transferableSnxInFloat = parseFloat(fromWei(transferableSnx));

expect(transferableSnxInFloat).toBeLessThan(snxBalanceInFloat);

// when-then
await expect(
snxContract.transfer(someAccount, snxBalance),
).rejects.toThrow();
});

test("exchange from sUSD to sXAU", async () => {
// given
const sUSDBefore = await sUSDContract.balanceOf(wallet.address);
Expand Down

1 comment on commit 947177e

@vercel
Copy link

@vercel vercel bot commented on 947177e Jun 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.