From 6770153aa9a7981d44bc7809178c65e5125b05a0 Mon Sep 17 00:00:00 2001 From: Nick Paterno <43416138+nicholasjpaterno@users.noreply.github.com> Date: Thu, 7 Nov 2019 12:28:53 -0500 Subject: [PATCH 1/2] Update typings for gasLimit Addresses #499 --- typings/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typings/index.d.ts b/typings/index.d.ts index 7c6092bf18..08cab91345 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -12,7 +12,7 @@ declare module "ganache-core" { default_balance_ether?: number; fork?: string | object; fork_block_number?: string | number; - gasLimit?: number; + gasLimit?: string | number; gasPrice?: string; hardfork?: "byzantium" | "constantinople" | "petersburg" | "istanbul"; hd_path?: string; From a2a16c3fc5c8c9d033e02a91a41eaee52fe92b94 Mon Sep 17 00:00:00 2001 From: "Nicholas J. Paterno" Date: Thu, 7 Nov 2019 12:38:04 -0500 Subject: [PATCH 2/2] Update gasLimit documentation Include numbers --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f70f48671..49959ccc86 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ Both `.provider()` and `.server()` take a single object which allows you to spec * `"hardfork"`: `String` Allows users to specify which hardfork should be used. Supported hardforks are `byzantium`, `constantinople`, `petersburg` (default), and `istanbul` (beta). * `"allowUnlimitedContractSize"`: `boolean` - Allows unlimited contract sizes while debugging (NOTE: this setting is often used in conjuction with an increased `gasLimit`). By setting this to `true`, the check within the EVM for contract size limit of 24KB (see [EIP-170](https://git.io/vxZkK)) is bypassed. Setting this to `true` **will** cause `ganache-core` to behave differently than production environments. (default: `false`; **ONLY** set to `true` during debugging). * `"gasPrice"`: `String::hex` Sets the default gas price for transactions if not otherwise specified. Must be specified as a `hex` encoded string in `wei`. Defaults to `"0x77359400"` (2 `gwei`). -* `"gasLimit"`: `String::hex` Sets the block gas limit. Must be specified as a `hex` string. Defaults to `"0x6691b7"`. +* `"gasLimit"`: `String::hex | number` Sets the block gas limit. Must be specified as a `hex` string or `number`(integer). Defaults to `"0x6691b7"`. * `"callGasLimit"`: `number` Sets the transaction gas limit for `eth_call` and `eth_estimateGas` calls. Must be specified as a `hex` string. Defaults to `"0x1fffffffffffff"` (`Number.MAX_SAFE_INTEGER`). * `"keepAliveTimeout"`: `number` If using `.server()` - Sets the HTTP server's `keepAliveTimeout` in milliseconds. See the [NodeJS HTTP docs](https://nodejs.org/api/http.html#http_server_keepalivetimeout) for details. `5000` by default.