aboutsummaryrefslogtreecommitdiffstats
path: root/test/utils
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-11-11 05:34:21 +0800
committerFabio Berger <me@fabioberger.com>2017-11-11 05:34:21 +0800
commit2bf65fda1f6b3018edbb4158574465326d4918be (patch)
tree5d0ab098003463d6df35fef4bef8b113d0939908 /test/utils
parentd90756e8ef2634737d41633f5427446b47223e98 (diff)
downloaddexon-sol-tools-2bf65fda1f6b3018edbb4158574465326d4918be.tar
dexon-sol-tools-2bf65fda1f6b3018edbb4158574465326d4918be.tar.gz
dexon-sol-tools-2bf65fda1f6b3018edbb4158574465326d4918be.tar.bz2
dexon-sol-tools-2bf65fda1f6b3018edbb4158574465326d4918be.tar.lz
dexon-sol-tools-2bf65fda1f6b3018edbb4158574465326d4918be.tar.xz
dexon-sol-tools-2bf65fda1f6b3018edbb4158574465326d4918be.tar.zst
dexon-sol-tools-2bf65fda1f6b3018edbb4158574465326d4918be.zip
Add tests for the numConfirmations config to ensure that the events are being emitted for the confirmation depth specified
Diffstat (limited to 'test/utils')
-rw-r--r--test/utils/blockchain_lifecycle.ts3
-rw-r--r--test/utils/rpc.ts7
2 files changed, 10 insertions, 0 deletions
diff --git a/test/utils/blockchain_lifecycle.ts b/test/utils/blockchain_lifecycle.ts
index 9fdf0e856..9a44ccd6f 100644
--- a/test/utils/blockchain_lifecycle.ts
+++ b/test/utils/blockchain_lifecycle.ts
@@ -20,4 +20,7 @@ export class BlockchainLifecycle {
throw new Error(`Snapshot with id #${snapshotId} failed to revert`);
}
}
+ public async mineABlock(): Promise<void> {
+ await this.rpc.mineBlockAsync();
+ }
}
diff --git a/test/utils/rpc.ts b/test/utils/rpc.ts
index f28a85340..1fc9f2428 100644
--- a/test/utils/rpc.ts
+++ b/test/utils/rpc.ts
@@ -26,6 +26,13 @@ export class RPC {
const didRevert = await this.sendAsync(payload);
return didRevert;
}
+ public async mineBlockAsync(): Promise<void> {
+ const method = 'evm_mine';
+ const params: any[] = [];
+ const payload = this.toPayload(method, params);
+ const didRevert = await this.sendAsync(payload);
+ return didRevert;
+ }
private toPayload(method: string, params: any[] = []): string {
const payload = JSON.stringify({
id: this.id,