use safe erc20 & new logGas

This commit is contained in:
mingda
2020-09-08 20:09:31 +08:00
parent d01c51e85b
commit 2e637f0916
5 changed files with 37 additions and 24 deletions

View File

@@ -101,14 +101,14 @@ describe("DODO ETH PROXY", () => {
describe("buy&sell eth directly", () => {
it("buy", async () => {
const buyAmount = "1";
logGas(
await DODOEthProxy.methods
await logGas(
DODOEthProxy.methods
.buyEthWithToken(
ctx.QUOTE.options.address,
decimalStr(buyAmount),
decimalStr("200")
)
.send(ctx.sendParam(trader)),
),
ctx.sendParam(trader),
"buy ETH with token directly"
);
assert.strictEqual(
@@ -122,14 +122,14 @@ describe("DODO ETH PROXY", () => {
});
it("sell", async () => {
const sellAmount = "1";
logGas(
await DODOEthProxy.methods
await logGas(
DODOEthProxy.methods
.sellEthToToken(
ctx.QUOTE.options.address,
decimalStr(sellAmount),
decimalStr("50")
)
.send(ctx.sendParam(trader, sellAmount)),
),
ctx.sendParam(trader, sellAmount),
"sell ETH to token directly"
);
assert.strictEqual(