rename DPP sync to ratioSync

This commit is contained in:
mingda
2020-12-21 23:16:55 +08:00
parent 4d180159ca
commit ad046a7b11
6 changed files with 116 additions and 71 deletions

View File

@@ -108,5 +108,26 @@ describe("Funding", () => {
assert.equal(await ctx.QUOTE.methods.balanceOf(ctx.CP.options.address).call(), decimalStr("49900"))
})
it("bid zero", async () => {
await ctx.EVM.increaseTime(86400 * 2)
await logGas(ctx.CP.methods.settle(), ctx.sendParam(ctx.Deployer), "settle")
var poolAddress = await ctx.CP.methods._POOL_().call()
var pool = getContractWithAddress(DVM_NAME, poolAddress)
assert.equal(await pool.methods.getMidPrice().call(), decimalStr("10"))
assert.equal(await ctx.CP.methods._AVG_SETTLED_PRICE_().call(), decimalStr("10"))
assert.equal(await ctx.CP.methods._UNUSED_QUOTE_().call(), "0")
assert.equal(await ctx.CP.methods._UNUSED_BASE_().call(), "0")
assert.equal(await ctx.BASE.methods.balanceOf(poolAddress).call(), decimalStr("10000"))
assert.equal(await ctx.BASE.methods.balanceOf(ctx.CP.options.address).call(), "0")
assert.equal(await ctx.QUOTE.methods.balanceOf(poolAddress).call(), "0")
assert.equal(await ctx.QUOTE.methods.balanceOf(ctx.CP.options.address).call(), "0")
})
})
})