Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' into hdwallet-provider-eip1559
Browse files Browse the repository at this point in the history
  • Loading branch information
XWJACK committed Oct 8, 2021
2 parents 20c456a + e0c903d commit 0f212cb
Show file tree
Hide file tree
Showing 135 changed files with 2,029 additions and 800 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- [ ] I've asked for help in the [Truffle Gitter](http://gitter.im/Consensys/truffle) before filing this issue.
- [ ] I've [opened a support ticket](https://trufflesuite.zendesk.com/hc/en-us/requests/new) before filing this issue.

---------------------------

Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,19 @@ on:

jobs:
yarncheck:
runs-on: ubuntu-20.04 #please unpin once possible
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- run: npm install -g yarn
- run: yarn bootstrap
- run: test -z "$(git diff)" || (echo 'Please run yarn and commit all changes to yarn.lock'; false)
- run: yarn install --ignore-scripts --frozen-lockfile --ignore-engines


build:
strategy:
matrix:
platform: [ubuntu-20.04] #please unpin once possible
node-version: [10.x, 12.x, 14.x]
platform: [ubuntu-latest]
node-version: [12.x, 14.x]
env: [GETH=true, PACKAGES=true, INTEGRATION=true]
runs-on: ${{ matrix.platform }}

Expand All @@ -53,7 +52,7 @@ jobs:

slack_notification:
needs: [yarncheck, build]
runs-on: ubuntu-20.04 #please unpin once possible
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: 8398a7/action-slack@v1.1.1
Expand Down
10 changes: 7 additions & 3 deletions packages/artifactor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@
"description": "A contract packager for Ethereum and Javascript",
"license": "MIT",
"author": "Tim Coulter",
"bugs": {
"url": "https://github.com/trufflesuite/truffle/issues"
},
"homepage": "https://github.com/trufflesuite/truffle/tree/master/packages/artifactor#readme",
"repository": {
"type": "git",
"url": "https://github.com/trufflesuite/truffle.git",
"directory": "packages/artifactor"
},
"version": "4.0.118",
"version": "4.0.126",
"main": "dist/index.js",
"scripts": {
"build": "tsc",
Expand All @@ -24,7 +28,7 @@
"lodash.merge": "^4.6.2"
},
"devDependencies": {
"@truffle/contract": "^4.3.30",
"@truffle/contract": "^4.3.38",
"@types/fs-extra": "^8.1.0",
"@types/lodash.assign": "^4.2.6",
"@types/lodash.merge": "^4.6.6",
Expand All @@ -38,7 +42,7 @@
"tmp": "^0.2.1",
"ts-node": "^9.0.0",
"typescript": "^4.1.4",
"web3": "1.5.2"
"web3": "1.5.3"
},
"publishConfig": {
"access": "public"
Expand Down
8 changes: 6 additions & 2 deletions packages/box/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
"description": "Truffle project boilerplate utility",
"license": "MIT",
"author": "g. nicholas d'andrea <gnidan@trufflesuite.com>",
"homepage": "https://github.com/trufflesuite/truffle/tree/master/packages/box#readme",
"repository": {
"type": "git",
"url": "https://github.com/trufflesuite/truffle.git",
"directory": "packages/box"
},
"version": "2.1.24",
"bugs": {
"url": "https://github.com/trufflesuite/truffle/issues"
},
"version": "2.1.30",
"main": "dist/box.js",
"scripts": {
"build": "tsc",
Expand All @@ -17,7 +21,7 @@
},
"types": "./typings/index.d.ts",
"dependencies": {
"@truffle/config": "^1.3.4",
"@truffle/config": "^1.3.10",
"axios": "^0.21.1",
"download-git-repo": "^3.0.2",
"fs-extra": "^9.1.0",
Expand Down
6 changes: 5 additions & 1 deletion packages/code-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
"description": "Utilities for parsing and managing EVM-compatible bytecode",
"license": "MIT",
"author": "",
"homepage": "https://github.com/trufflesuite/truffle/tree/master/packages/code-utils#readme",
"repository": {
"type": "git",
"url": "https://github.com/trufflesuite/truffle.git",
"directory": "packages/code-utils"
},
"version": "1.2.29",
"bugs": {
"url": "https://github.com/trufflesuite/truffle/issues"
},
"version": "1.2.30",
"main": "dist/src/index.js",
"scripts": {
"build": "tsc",
Expand Down
5 changes: 5 additions & 0 deletions packages/codec/lib/abi-data/allocate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ function abiSizeAndAllocate(
case "fixed":
case "ufixed":
case "enum":
case "userDefinedValueType":
return {
size: Evm.Utils.WORD_SIZE,
dynamic: false,
Expand Down Expand Up @@ -367,6 +368,7 @@ function allocateCalldataAndReturndata(
let inputParametersAbi: Abi.Parameter[];
let outputParametersAbi: Abi.Parameter[];
let offset: number; //refers to INPUT offset; output offset is always 0
debug("allocating calldata and returndata");
switch (abiEntry.type) {
case "constructor":
if (!constructorContext) {
Expand Down Expand Up @@ -405,6 +407,7 @@ function allocateCalldataAndReturndata(
),
contractNode
).node; //may be undefined! that's OK!
debug("found node: %o", Boolean(node));
}
break;
}
Expand Down Expand Up @@ -463,6 +466,7 @@ function allocateCalldataAndReturndata(
compiler
//note no offset
);
debug("modes: %s in, %s out", inputMode, outputMode);
//finally: transform the allocation appropriately
let inputArgumentsAllocation = abiAllocationInput.members.map(member => ({
...member,
Expand Down Expand Up @@ -546,6 +550,7 @@ function allocateDataArguments(
)[id];
} catch {
//if something goes wrong, switch to ABI mdoe
debug("falling back to ABI due to exception!");
allocationMode = "abi";
}
}
Expand Down
49 changes: 42 additions & 7 deletions packages/codec/lib/abify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import * as Conversion from "@truffle/codec/conversion";
export function abifyType(
dataType: Format.Types.Type,
userDefinedTypes?: Format.Types.TypesById
): Format.Types.Type | undefined {
): Format.Types.AbiType | undefined {
switch (dataType.typeClass) {
//we only need to specially handle types that don't go in
//the ABI, or that have some information loss when going
Expand All @@ -23,6 +23,7 @@ export function abifyType(
//First: types that do not go in the ABI
case "mapping":
case "magic":
case "type":
return undefined;
//Next: address & contract, these can get handled together
case "address":
Expand Down Expand Up @@ -50,7 +51,7 @@ export function abifyType(
const fullType = <Format.Types.StructType>(
Format.Types.fullType(dataType, userDefinedTypes)
);
if (!fullType) {
if (!fullType.memberTypes) {
let typeToDisplay = Format.Types.typeString(dataType);
throw new Common.UnknownUserDefinedTypeError(
dataType.id,
Expand All @@ -73,7 +74,7 @@ export function abifyType(
const fullType = <Format.Types.EnumType>(
Format.Types.fullType(dataType, userDefinedTypes)
);
if (!fullType) {
if (!fullType.options) {
let typeToDisplay = Format.Types.typeString(dataType);
throw new Common.UnknownUserDefinedTypeError(
dataType.id,
Expand All @@ -88,6 +89,26 @@ export function abifyType(
typeHint: Format.Types.typeString(fullType)
};
}
case "userDefinedValueType": {
const fullType = <Format.Types.UserDefinedValueTypeType>(
Format.Types.fullType(dataType, userDefinedTypes)
);
if (!fullType.underlyingType) {
let typeToDisplay = Format.Types.typeString(dataType);
throw new Common.UnknownUserDefinedTypeError(
dataType.id,
typeToDisplay
);
}
const abifiedUnderlying = abifyType(
fullType.underlyingType,
userDefinedTypes
);
return {
...abifiedUnderlying,
typeHint: Format.Types.typeStringWithoutLocation(dataType)
};
}
//finally: arrays
case "array":
return {
Expand All @@ -105,10 +126,11 @@ export function abifyType(
export function abifyResult(
result: Format.Values.Result,
userDefinedTypes?: Format.Types.TypesById
): Format.Values.Result | undefined {
): Format.Values.AbiResult | undefined {
switch (result.type.typeClass) {
case "mapping": //doesn't go in ABI
case "magic": //doesn't go in ABI
case "type": //doesn't go in ABI
return undefined;
case "address":
//abify the type but leave the value alone
Expand Down Expand Up @@ -187,20 +209,33 @@ export function abifyResult(
);
return {
kind: "value",
type: <Format.Types.StructType>(
type: <Format.Types.TupleType>(
abifyType(result.type, userDefinedTypes)
), //note: may throw exception
value: abifiedMembers
};
case "error":
return {
...coercedResult,
type: <Format.Types.StructType>(
type: <Format.Types.TupleType>(
abifyType(result.type, userDefinedTypes)
) //note: may throw exception
};
}
}
case "userDefinedValueType": {
const coercedResult = <Format.Values.UserDefinedValueTypeResult>result;
switch (coercedResult.kind) {
case "value":
return abifyResult(coercedResult.value, userDefinedTypes);
case "error":
return <Format.Errors.BuiltInValueErrorResult>{ //I have no idea what TS is thinking here
...coercedResult,
type: abifyType(result.type, userDefinedTypes)
};
}
break; //to satisfy TS :P
}
case "enum": {
//NOTE: this is the one case where errors are converted to non-error values!!
//(other than recursively, I mean)
Expand Down Expand Up @@ -295,7 +330,7 @@ export function abifyResult(
}
}
default:
return result;
return <Format.Values.AbiResult>result; //just coerce :-/
}
}

Expand Down
Loading

0 comments on commit 0f212cb

Please sign in to comment.