add weth 2 eth support in crowdpooling

This commit is contained in:
牛涛涛
2021-01-08 01:59:35 +08:00
parent e51ae35704
commit 86a8f303a4
6 changed files with 38 additions and 11 deletions

View File

@@ -41,6 +41,7 @@ describe("Funding", () => {
freezeDuration: new BigNumber(86400),
vestingDuration: new BigNumber(86400),
cliffRate: decimalStr("1"),
quoteTokenContract:""
}
ctx = new CPContext();
await ctx.init(config);
@@ -57,7 +58,7 @@ describe("Funding", () => {
describe("bid & cancel", () => {
it("bid", async () => {
it("bid and cancel", async () => {
await ctx.QUOTE.methods.transfer(ctx.CP.options.address, decimalStr("100")).send(ctx.sendParam(bidder1))
await logGas(ctx.CP.methods.bid(bidder1), ctx.sendParam(bidder1), "bid")
assert.equal(await ctx.CP.methods.getShares(bidder1).call(), decimalStr("99.9"))
@@ -75,6 +76,7 @@ describe("Funding", () => {
assert.equal(await ctx.CP.methods.getShares(bidder1).call(), decimalStr("79.9"))
assert.equal(await ctx.CP.methods._TOTAL_SHARES_().call(), decimalStr("129.85"))
assert.equal(await ctx.QUOTE.methods.balanceOf(bidder1).call(), decimalStr("920"))
})
})