From d5ecfd8032b41ac24edf18499338b46178138277 Mon Sep 17 00:00:00 2001 From: mingda Date: Tue, 22 Sep 2020 00:48:15 +0800 Subject: [PATCH] fix evm increase time --- test/utils/EVM.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/utils/EVM.ts b/test/utils/EVM.ts index a1afc9d..75e071a 100644 --- a/test/utils/EVM.ts +++ b/test/utils/EVM.ts @@ -47,8 +47,17 @@ export class EVM { return this.callJsonrpcMethod('evm_mine'); } + public async fastMove(moveBlockNum: number): Promise { + var res: string + for (let i = 0; i < moveBlockNum; i++) { + res = await this.callJsonrpcMethod('evm_mine'); + } + return res + } + public async increaseTime(duration: number): Promise { - return this.callJsonrpcMethod('evm_increaseTime', [duration]); + await this.callJsonrpcMethod('evm_increaseTime', [duration]); + return this.callJsonrpcMethod('evm_mine'); } public async callJsonrpcMethod(method: string, params?: (any[])): Promise {