From 6a1746242f2759c187cd1b47df58f2597126f0d6 Mon Sep 17 00:00:00 2001 From: Saransh Sharma Date: Mon, 30 Mar 2020 14:48:30 +0530 Subject: [PATCH 1/3] Unit Tests --- CHANGELOG.md | 3 +++ package-lock.json | 8 ++++---- packages/web3-utils/types/index.d.ts | 1 + .../types/tests/json-interface-method-to-string-test.ts | 3 ++- test/contract.encodeABI.js | 3 ++- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29e7aad08e9..7697ab99896 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --> +## [1.2.6] +Added gas type in Contract AbiItem + ## [1.2.0] Released with 1.0.0-beta.37 code base. diff --git a/package-lock.json b/package-lock.json index a0374711def..7b8506a5023 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "web3", - "version": "1.2.5", + "version": "1.2.6", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -16875,9 +16875,9 @@ } }, "typescript": { - "version": "3.8.0-dev.20200130", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.0-dev.20200130.tgz", - "integrity": "sha512-DJkyFlY26aZLF7CEP7L27ulA0Gml3vNR2C0Uhvz/Meb/9Zk4GVBLZz1wYeY05kcww6zdraKGds/OVUcK4Y9JGQ==", + "version": "3.9.0-dev.20200330", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.0-dev.20200330.tgz", + "integrity": "sha512-RI1hwkdnHUbQ78PT/VbLgrMjyb47/8+G2CIfuWW6lBAQIwgqjEyYlKW9PbDRG3WlHXieTMkE3Rjwn9hF08dU3Q==", "dev": true }, "uglify-js": { diff --git a/packages/web3-utils/types/index.d.ts b/packages/web3-utils/types/index.d.ts index da2f261daa8..fad6c39db85 100644 --- a/packages/web3-utils/types/index.d.ts +++ b/packages/web3-utils/types/index.d.ts @@ -220,6 +220,7 @@ export interface AbiItem { payable?: boolean; stateMutability?: StateMutabilityType; type: AbiType; + gas?: number; } export interface AbiInput { diff --git a/packages/web3-utils/types/tests/json-interface-method-to-string-test.ts b/packages/web3-utils/types/tests/json-interface-method-to-string-test.ts index 649b6609c6a..7db99e00a1b 100644 --- a/packages/web3-utils/types/tests/json-interface-method-to-string-test.ts +++ b/packages/web3-utils/types/tests/json-interface-method-to-string-test.ts @@ -101,7 +101,8 @@ const abiItem: AbiItem = { ], payable: false, stateMutability: "pure", - type: "function" + type: "function", + gas: 175875 }; // $ExpectType string jsonInterfaceMethodToString(abiItem); diff --git a/test/contract.encodeABI.js b/test/contract.encodeABI.js index 5d5172c078d..754483d4d8e 100644 --- a/test/contract.encodeABI.js +++ b/test/contract.encodeABI.js @@ -28,7 +28,8 @@ var abi = [ ], payable: false, type: "function", - stateMutability: "view" + stateMutability: "view", + gas: 175875 } ]; From 41a072f65ff336dda78a36195ef245d83c36b1ac Mon Sep 17 00:00:00 2001 From: Maek Twain Date: Tue, 31 Mar 2020 16:33:01 +0530 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c84bfa5027e..c3aaf0ea3fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,7 +35,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --> ## [1.2.6] -Added gas type in Contract AbiItem +### Added + +- Added gas type in Contract AbiItem ## [1.2.0] From 2e15ff438ca660116c1d9394cedad81a50deb2f3 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Thu, 9 Apr 2020 12:15:05 -0700 Subject: [PATCH 3/3] Fix changelog --- CHANGELOG.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3610cef24bd..c16a9a31f9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,11 +34,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --> -## [1.2.6] -### Added - -- Added gas type in Contract AbiItem - ## [1.2.0] Released with 1.0.0-beta.37 code base. @@ -149,6 +144,7 @@ Released with 1.0.0-beta.37 code base. - Add revert reason support to sendSignedTransaction - ENS module extended with the possibility to add a custom registry (#3301) - Missing ENS Registry methods and Resolver.supportsInterface method added (#3325) +- Add optional gas type to AbiItem typescript definitions (for ABIs generated by Vyper) ### Changed