Skip to content

Commit

Permalink
Merge pull request #92 from benjamincburns/update-abi-utils
Browse files Browse the repository at this point in the history
Bump @truffle/abi-utils to ^0.3.0, drop dependency @truffle/codec
  • Loading branch information
gnidan authored Aug 25, 2022
2 parents d2ededc + e9b3d21 commit d2a0004
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 110 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
- Cleanup imports ([#88](https://github.com/gnidan/abi-to-sol/pull/88) by
[@gnidan](https://github.com/gnidan))

### Dependency changes

- Bump @truffle/abi-utils to ^0.3.0, drop dependency @truffle/codec
([#92](https://github.com/gnidan/abi-to-sol/pull/92) by
[@benjamincburns](https://github.com/benjamincburns))

## v0.6.5

See [release notes](https://github.com/gnidan/abi-to-sol/releases/tag/v0.6.5).
Expand Down
5 changes: 2 additions & 3 deletions packages/abi-to-sol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@types/semver": "^7.3.7",
"change-case": "^4.1.1",
"faker": "^5.1.0",
"fast-check": "^2.4.0",
"fast-check": "^3.1.1",
"husky": ">=4",
"jest": "^26.4.2",
"jest-fast-check": "^0.0.1",
Expand All @@ -46,8 +46,7 @@
"typescript": "4.5.2"
},
"dependencies": {
"@truffle/abi-utils": "^0.2.2",
"@truffle/codec": "^0.14.0",
"@truffle/abi-utils": "^0.3.0",
"@truffle/contract-schema": "^3.3.1",
"ajv": "^6.12.5",
"better-ajv-errors": "^0.8.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/abi-to-sol/src/declarations.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type {Abi as SchemaAbi} from "@truffle/contract-schema/spec";
import * as Codec from "@truffle/codec";
import type * as Abi from "@truffle/abi-utils";
import { abiTupleSignature } from "@truffle/abi-utils";

import {Visitor, VisitOptions, dispatch, Node} from "./visitor";

Expand Down Expand Up @@ -78,15 +78,15 @@ export class DeclarationsCollector implements Visitor<Declarations> {

let container = "";
const components = parameter.components || [];
const signature = Codec.AbiData.Utils.abiTupleSignature(components);
const signature = abiTupleSignature(components);
const declaration: Declaration = {
components: components.map(({name, type, components}) =>
!components
? {name, type}
: {
name,
type,
signature: Codec.AbiData.Utils.abiTupleSignature(components),
signature: abiTupleSignature(components),
}
),
};
Expand Down
5 changes: 2 additions & 3 deletions packages/abi-to-sol/src/solidity.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type Prettier from "prettier";
import * as Codec from "@truffle/codec";
import type * as Abi from "@truffle/abi-utils";
import { abiTupleSignature } from "@truffle/abi-utils";
import type {Abi as SchemaAbi} from "@truffle/contract-schema/spec";

import { version } from "../package.json";
import {Visitor, VisitOptions, dispatch, Node} from "./visitor";
import { forRange, VersionFeatures, mixed } from "./version-features";
Expand Down Expand Up @@ -466,7 +465,7 @@ class SolidityGenerator implements Visitor<string, Context | undefined> {
}

if ("components" in variable && variable.components) {
return Codec.AbiData.Utils.abiTupleSignature(variable.components);
return abiTupleSignature(variable.components);
}
}

Expand Down
125 changes: 24 additions & 101 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3243,48 +3243,16 @@
resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82"
integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==

"@truffle/abi-utils@^0.2.15":
version "0.2.15"
resolved "https://registry.yarnpkg.com/@truffle/abi-utils/-/abi-utils-0.2.15.tgz#7057fc2b694b61516dd484c8e877ceb549016910"
integrity sha512-Ykcz4M2EgSCtRuS7lChZMavb+uJlh3Rs0Hfws2p4Widr1HHlw98hZCyrwU2W8yJW9mfib0URl6RLestElwbQwA==
"@truffle/abi-utils@^0.3.0":
version "0.3.0"
resolved "https://registry.yarnpkg.com/@truffle/abi-utils/-/abi-utils-0.3.0.tgz#edbdce6152c6ee711b7b8e267ff5745891931c59"
integrity sha512-W4Kbm17+QQeeK/uXB80t10gw1H8lEnAu+B7bu7NZl2Zy74kwhsrGC+qCjynhRQtGsFnCcsI58VxjjNkn1PsgSg==
dependencies:
change-case "3.0.2"
faker "5.5.3"
fast-check "2.15.1"

"@truffle/abi-utils@^0.2.2":
version "0.2.2"
resolved "https://registry.yarnpkg.com/@truffle/abi-utils/-/abi-utils-0.2.2.tgz#2d1b92a2ffb7887ec5a0163cd5415aab552b34af"
integrity sha512-GRphTbgqrsz0B43t5gNGRlMNV/L3LUv9oZXWqw6+ySEiZo1l/p6AA8cPmHp9jbA/dHyqx4MKSQ94qTR2siy0Eg==
dependencies:
change-case "3.0.2"
faker "^5.3.1"
fast-check "^2.12.1"

"@truffle/codec@^0.14.0":
version "0.14.0"
resolved "https://registry.yarnpkg.com/@truffle/codec/-/codec-0.14.0.tgz#81095bfd1c7bc9d893c41f0c6e0b4ebcb5826a1b"
integrity sha512-Tbcxv5Vi/E7eYGiCHPVGWxWwWowcBIp8iiaOW5mahyhpjT28f6nySWtCkv9CF+Dx+doDqRXAKyIQPKsjQ+8CWg==
dependencies:
"@truffle/abi-utils" "^0.2.15"
"@truffle/compile-common" "^0.7.32"
big.js "^6.0.3"
bn.js "^5.1.3"
cbor "^5.1.0"
debug "^4.3.1"
lodash "^4.17.21"
semver "7.3.7"
utf8 "^3.0.0"
fast-check "3.1.1"
web3-utils "1.7.4"

"@truffle/compile-common@^0.7.32":
version "0.7.32"
resolved "https://registry.yarnpkg.com/@truffle/compile-common/-/compile-common-0.7.32.tgz#3ea6ebfe99bb2bc339ca7723d491e7c52a999aed"
integrity sha512-SzIxwwQj8mJwoa7/kjkAslGenB4NejhmRHmdWdxNS5fqg2XqKhmSJcjir5qFjjvNzjcFZGecLg4EOm1Hj6letw==
dependencies:
"@truffle/error" "^0.1.0"
colors "1.4.0"

"@truffle/contract-schema@^3.3.1", "@truffle/contract-schema@^3.4.1":
version "3.4.1"
resolved "https://registry.yarnpkg.com/@truffle/contract-schema/-/contract-schema-3.4.1.tgz#13b404383d438b48960862022a20102970323666"
Expand All @@ -3294,11 +3262,6 @@
crypto-js "^3.1.9-1"
debug "^4.3.1"

"@truffle/error@^0.1.0":
version "0.1.0"
resolved "https://registry.yarnpkg.com/@truffle/error/-/error-0.1.0.tgz#5e9fed79e6cda624c926d314b280a576f8b22a36"
integrity sha512-RbUfp5VreNhsa2Q4YbBjz18rOQI909pG32bghl1hulO7IpvcqTS+C3Ge5cNbiWQ1WGzy1wIeKLW0tmQtHFB7qg==

"@types/aria-query@^4.2.0":
version "4.2.2"
resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.2.tgz#ed4e0ad92306a704f9fb132a0cfcf77486dbe2bc"
Expand Down Expand Up @@ -4642,16 +4605,6 @@ big.js@^5.2.2:
resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328"
integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==

big.js@^6.0.3:
version "6.2.0"
resolved "https://registry.yarnpkg.com/big.js/-/big.js-6.2.0.tgz#39c60822aecb0f34a1d79a90fe9908a0ddf45e1d"
integrity sha512-paIKvJiAaOYdLt6MfnvxkDo64lTOV257XYJyX3oJnJQocIclUn+48k6ZerH/c5FxWE6DGJu1TKDYis7tqHg9kg==

bignumber.js@^9.0.1:
version "9.0.2"
resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.2.tgz#71c6c6bed38de64e24a65ebe16cfcf23ae693673"
integrity sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw==

binary-extensions@^1.0.0:
version "1.13.1"
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65"
Expand Down Expand Up @@ -4689,7 +4642,7 @@ bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9:
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88"
integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==

bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.3:
bn.js@^5.0.0, bn.js@^5.1.1:
version "5.2.0"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002"
integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==
Expand Down Expand Up @@ -5116,14 +5069,6 @@ caseless@~0.12.0:
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=

cbor@^5.1.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/cbor/-/cbor-5.2.0.tgz#4cca67783ccd6de7b50ab4ed62636712f287a67c"
integrity sha512-5IMhi9e1QU76ppa5/ajP1BmMWZ2FHkhAhjeVKQ/EFCgYSEaeVaoGtL7cxJskf9oCCk+XjzaIdc3IuU/dbA/o2A==
dependencies:
bignumber.js "^9.0.1"
nofilter "^1.0.4"

chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.1, chalk@^2.4.2:
version "2.4.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
Expand Down Expand Up @@ -5460,11 +5405,6 @@ colorette@^1.2.1, colorette@^1.2.2:
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94"
integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==

colors@1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78"
integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==

columnify@^1.5.4:
version "1.5.4"
resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb"
Expand Down Expand Up @@ -7388,24 +7328,17 @@ extsprintf@^1.2.0:
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=

faker@5.5.3, faker@^5.1.0, faker@^5.3.1:
faker@5.5.3, faker@^5.1.0:
version "5.5.3"
resolved "https://registry.yarnpkg.com/faker/-/faker-5.5.3.tgz#c57974ee484431b25205c2c8dc09fda861e51e0e"
integrity sha512-wLTv2a28wjUyWkbnX7u/ABZBkUkIF2fCd73V6P2oFqEGEktDfzWx4UxrSqtPRw0xPRAcjeAOIiJWqZm3pP4u3g==

fast-check@2.15.1:
version "2.15.1"
resolved "https://registry.yarnpkg.com/fast-check/-/fast-check-2.15.1.tgz#a60c5ba0d5cba68a1176353c423c3733c02bb603"
integrity sha512-eNcOxh7iTLGwebRCRU+F+/Ne+41/7ra4qn1bhljAO+uqvxB9p4Qq/rqNeu3wls/ka9jnu9MvwUE/m1sTWcbGBg==
dependencies:
pure-rand "^4.1.1"

fast-check@^2.12.1, fast-check@^2.4.0:
version "2.17.0"
resolved "https://registry.yarnpkg.com/fast-check/-/fast-check-2.17.0.tgz#9b9637684332be386219a5f73a4799874da7461c"
integrity sha512-fNNKkxNEJP+27QMcEzF6nbpOYoSZIS0p+TyB+xh/jXqRBxRhLkiZSREly4ruyV8uJi7nwH1YWAhi7OOK5TubRw==
fast-check@3.1.1, fast-check@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/fast-check/-/fast-check-3.1.1.tgz#72c5ae7022a4e86504762e773adfb8a5b0b01252"
integrity sha512-3vtXinVyuUKCKFKYcwXhGE6NtGWkqF8Yh3rvMZNzmwz8EPrgoc/v4pDdLHyLnCyCI5MZpZZkDEwFyXyEONOxpA==
dependencies:
pure-rand "^5.0.0"
pure-rand "^5.0.1"

fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
version "3.1.3"
Expand Down Expand Up @@ -10974,11 +10907,6 @@ node-releases@^1.1.61, node-releases@^1.1.71:
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.73.tgz#dd4e81ddd5277ff846b80b52bb40c49edf7a7b20"
integrity sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg==

nofilter@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/nofilter/-/nofilter-1.0.4.tgz#78d6f4b6a613e7ced8b015cec534625f7667006e"
integrity sha512-N8lidFp+fCz+TD51+haYdbDGrcBWwuHX40F5+z0qkUjMJ5Tp+rdSuAkMJ9N9eoolDlEVTf6u5icM+cNKkKW2mA==

nopt@^4.0.1:
version "4.0.3"
resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.3.tgz#a375cad9d02fd921278d954c2254d5aa57e15e48"
Expand Down Expand Up @@ -12772,15 +12700,10 @@ punycode@^2.1.0, punycode@^2.1.1:
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==

pure-rand@^4.1.1:
version "4.2.1"
resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-4.2.1.tgz#14c08ab1cebce0eb95b987638039742a1006a695"
integrity sha512-ESI2eqHP9JlrnTb7H7fgczRUWB6VxMMJ2m9870WCIBhYkBzSGd6gml6WhQVXHK+ZM8k70TqsyI28ixaLPaNz5g==

pure-rand@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-5.0.0.tgz#87f5bdabeadbd8904e316913a5c0b8caac517b37"
integrity sha512-lD2/y78q+7HqBx2SaT6OT4UcwtvXNRfEpzYEzl0EQ+9gZq2Qi3fa0HDnYPeqQwhlHJFBUhT7AO3mLU3+8bynHA==
pure-rand@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-5.0.1.tgz#97a287b4b4960b2a3448c0932bf28f2405cac51d"
integrity sha512-ksWccjmXOHU2gJBnH0cK1lSYdvSZ0zLoCMSz/nTGh6hDvCSgcRxDyIcOBD6KNxFz3xhMPm/T267Tbe2JRymKEQ==

q@^1.1.2, q@^1.5.1:
version "1.5.1"
Expand Down Expand Up @@ -13745,13 +13668,6 @@ semver@7.3.2:
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938"
integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==

semver@7.3.7, semver@^7.3.7:
version "7.3.7"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f"
integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==
dependencies:
lru-cache "^6.0.0"

semver@7.x, semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5:
version "7.3.5"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
Expand All @@ -13764,6 +13680,13 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==

semver@^7.3.7:
version "7.3.7"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f"
integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==
dependencies:
lru-cache "^6.0.0"

send@0.17.1:
version "0.17.1"
resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8"
Expand Down Expand Up @@ -15400,7 +15323,7 @@ use@^3.1.0:
resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f"
integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==

utf8@3.0.0, utf8@^3.0.0:
utf8@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1"
integrity sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==
Expand Down

0 comments on commit d2a0004

Please sign in to comment.