@truffle/abi-utils
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -29,3 +29,3 @@ "use strict"; | ||
const change_case_1 = require("change-case"); | ||
exports.Parameter = () => fc | ||
const Parameter = () => fc | ||
.tuple(fc.record({ | ||
@@ -35,3 +35,4 @@ name: ParameterName() | ||
.map(([{ name }, type]) => (Object.assign({ name }, type))); | ||
exports.EventParameter = () => fc | ||
exports.Parameter = Parameter; | ||
const EventParameter = () => fc | ||
.tuple(fc.record({ | ||
@@ -42,3 +43,4 @@ name: ParameterName(), | ||
.map(([{ name, indexed }, type]) => (Object.assign({ name, indexed }, type))); | ||
exports.EventEntry = () => fc.record({ | ||
exports.EventParameter = EventParameter; | ||
const EventEntry = () => fc.record({ | ||
type: fc.constant("event"), | ||
@@ -57,3 +59,4 @@ name: EventName(), | ||
}); | ||
exports.FunctionEntry = () => fc | ||
exports.EventEntry = EventEntry; | ||
const FunctionEntry = () => fc | ||
.tuple(fc.record({ | ||
@@ -87,7 +90,9 @@ type: fc.constant("function") | ||
}); | ||
exports.ReceiveEntry = () => fc.record({ | ||
exports.FunctionEntry = FunctionEntry; | ||
const ReceiveEntry = () => fc.record({ | ||
type: fc.constant("receive"), | ||
stateMutability: fc.constant("payable") | ||
}); | ||
exports.FallbackEntry = () => fc | ||
exports.ReceiveEntry = ReceiveEntry; | ||
const FallbackEntry = () => fc | ||
.tuple(fc.record({ | ||
@@ -107,3 +112,4 @@ type: fc.constant("fallback") | ||
.map(([{ type }, mutabilityFields]) => (Object.assign({ type }, mutabilityFields))); | ||
exports.ConstructorEntry = () => fc | ||
exports.FallbackEntry = FallbackEntry; | ||
const ConstructorEntry = () => fc | ||
.tuple(fc.record({ | ||
@@ -125,5 +131,7 @@ type: fc.constant("constructor"), | ||
inputs }, mutabilityFields))); | ||
exports.Abi = () => fc | ||
exports.ConstructorEntry = ConstructorEntry; | ||
const Abi = () => fc | ||
.tuple(exports.ConstructorEntry(), exports.FallbackEntry(), exports.ReceiveEntry(), fc.array(fc.oneof(exports.FunctionEntry(), exports.EventEntry()))) | ||
.chain(([constructor, fallback, receive, entries]) => fc.shuffledSubarray([constructor, fallback, receive, ...entries])); | ||
exports.Abi = Abi; | ||
var Numerics; | ||
@@ -130,0 +138,0 @@ (function (Numerics) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.normalizeEntry = exports.normalize = void 0; | ||
exports.normalize = (looseAbi) => looseAbi.map(exports.normalizeEntry); | ||
exports.normalizeEntry = (looseEntry) => { | ||
const normalize = (looseAbi) => looseAbi.map(exports.normalizeEntry); | ||
exports.normalize = normalize; | ||
const normalizeEntry = (looseEntry) => { | ||
if (looseEntry.type === "event" || looseEntry.type === "error") { | ||
@@ -18,2 +19,3 @@ // nothing gets normalized for events or errorsright now | ||
}; | ||
exports.normalizeEntry = normalizeEntry; | ||
const normalizeStateMutability = ({ stateMutability, payable, constant }) => { | ||
@@ -20,0 +22,0 @@ if (stateMutability) { |
{ | ||
"name": "@truffle/abi-utils", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Utilities for working with ABIs", | ||
@@ -33,21 +33,21 @@ "keywords": [ | ||
"devDependencies": { | ||
"@truffle/contract-schema": "^3.3.3", | ||
"@truffle/contract-schema": "^3.3.4", | ||
"@types/faker": "^5.1.2", | ||
"@types/jest": "^26.0.14", | ||
"@types/jest": "^26.0.20", | ||
"@types/jest-json-schema": "^2.1.2", | ||
"jest": "^26.4.2", | ||
"jest": "^26.5.2", | ||
"jest-extended": "^0.11.5", | ||
"jest-fast-check": "^0.0.1", | ||
"jest-fast-check": "^1.0.1", | ||
"jest-json-schema": "^2.1.0", | ||
"ts-jest": "^26.4.0", | ||
"ts-jest": "^26.4.1", | ||
"ts-node": "^9.0.0", | ||
"typescript": "^4.0.3" | ||
"typescript": "^4.1.4" | ||
}, | ||
"dependencies": { | ||
"change-case": "^4.1.1", | ||
"faker": "^5.1.0", | ||
"fast-check": "^2.4.0", | ||
"change-case": "3.0.2", | ||
"faker": "^5.3.1", | ||
"fast-check": "^2.12.1", | ||
"source-map-support": "^0.5.19" | ||
}, | ||
"gitHead": "dce3085ee50de3ed83a55bd6fe038a843ea75e7a" | ||
"gitHead": "5f8fa364c8a0dbf0e07827035b1c335901549097" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46134
620
+ Addedcamel-case@3.0.0(transitive)
+ Addedchange-case@3.0.2(transitive)
+ Addedconstant-case@2.0.0(transitive)
+ Addeddot-case@2.1.1(transitive)
+ Addedheader-case@1.0.1(transitive)
+ Addedis-lower-case@1.1.3(transitive)
+ Addedis-upper-case@1.1.2(transitive)
+ Addedlower-case@1.1.4(transitive)
+ Addedlower-case-first@1.0.2(transitive)
+ Addedno-case@2.3.2(transitive)
+ Addedparam-case@2.1.1(transitive)
+ Addedpascal-case@2.0.1(transitive)
+ Addedpath-case@2.1.1(transitive)
+ Addedsentence-case@2.1.1(transitive)
+ Addedsnake-case@2.1.0(transitive)
+ Addedswap-case@1.1.2(transitive)
+ Addedtitle-case@2.1.1(transitive)
+ Addedupper-case@1.1.3(transitive)
+ Addedupper-case-first@1.1.2(transitive)
- Removedcamel-case@4.1.2(transitive)
- Removedcapital-case@1.0.4(transitive)
- Removedchange-case@4.1.2(transitive)
- Removedconstant-case@3.0.4(transitive)
- Removeddot-case@3.0.4(transitive)
- Removedheader-case@2.0.4(transitive)
- Removedlower-case@2.0.2(transitive)
- Removedno-case@3.0.4(transitive)
- Removedparam-case@3.0.4(transitive)
- Removedpascal-case@3.1.2(transitive)
- Removedpath-case@3.0.4(transitive)
- Removedsentence-case@3.0.4(transitive)
- Removedsnake-case@3.0.4(transitive)
- Removedtslib@2.8.1(transitive)
- Removedupper-case@2.0.2(transitive)
- Removedupper-case-first@2.0.2(transitive)
Updatedchange-case@3.0.2
Updatedfaker@^5.3.1
Updatedfast-check@^2.12.1