Skip to content

Commit e66ce74

Browse files
committed
admin: updated dist files
1 parent 8f99601 commit e66ce74

18 files changed

+265
-73
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ Change Log
33

44
This change log is maintained by `src.ts/_admin/update-changelog.ts` but may also be manually updated.
55

6-
ethers/v6.10.1 (2024-01-15 23:07)
6+
ethers/v6.10.1 (2024-01-16 17:43)
77
---------------------------------
88

99
- Updated third-party provider network URLs ([#4542](https://github.com/ethers-io/ethers.js/issues/4542); [84ca14f](https://github.com/ethers-io/ethers.js/commit/84ca14f1ffc5afbdd7f4c26a9b734ec5951eee3c)).
1010
- Added additional sepolia testnets ([4efef76](https://github.com/ethers-io/ethers.js/commit/4efef76e8cab0acaf1b2ba231a0148f9381bb1ee)).
11-
- Fix EIP-712 type aliases for uint and int ([#4541](https://github.com/ethers-io/ethers.js/issues/4541); [43fb9c2](https://github.com/ethers-io/ethers.js/commit/43fb9c233696aeaa80b1c2b0e5fafce90e0ad508)).
11+
- Fix EIP-712 type aliases for uint and int ([#4541](https://github.com/ethers-io/ethers.js/issues/4541); [43fb9c2](https://github.com/ethers-io/ethers.js/commit/43fb9c233696aeaa80b1c2b0e5fafce90e0ad508), [8f99601](https://github.com/ethers-io/ethers.js/commit/8f99601df1f26a8ba4d6d9dea5e033e7f688107e)).
1212
- Fixed typo in Error string ([#4539](https://github.com/ethers-io/ethers.js/issues/4539); [7882905](https://github.com/ethers-io/ethers.js/commit/78829050853093bc5291ae78fc5a904044759aa0)).
1313
- Better debugging output on fetch errors ([bee07a0](https://github.com/ethers-io/ethers.js/commit/bee07a0750b448a9d13c2d57014bcf27f43e2ed7)).
1414

dist/ethers.js

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10552,6 +10552,23 @@ function getBaseEncoder(type) {
1055210552
function encodeType(name, fields) {
1055310553
return `${name}(${fields.map(({ name, type }) => (type + " " + name)).join(",")})`;
1055410554
}
10555+
// foo[][3] => { base: "foo", index: "[][3]", array: {
10556+
// base: "foo", prefix: "foo[]", count: 3 } }
10557+
function splitArray(type) {
10558+
const match = type.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);
10559+
if (match) {
10560+
return {
10561+
base: match[1],
10562+
index: (match[2] + match[4]),
10563+
array: {
10564+
base: match[1],
10565+
prefix: (match[1] + match[2]),
10566+
count: (match[5] ? parseInt(match[5]) : -1),
10567+
}
10568+
};
10569+
}
10570+
return { base: type };
10571+
}
1055510572
/**
1055610573
* A **TypedDataEncode** prepares and encodes [[link-eip-712]] payloads
1055710574
* for signed typed data.
@@ -10597,15 +10614,16 @@ class TypedDataEncoder {
1059710614
const subtypes = new Map();
1059810615
const types = {};
1059910616
Object.keys(_types).forEach((type) => {
10600-
// Normalize int/uint unless they are a complex type themselves
1060110617
types[type] = _types[type].map(({ name, type }) => {
10602-
if (type === "int" && !_types["int"]) {
10603-
type = "int256";
10618+
// Normalize the base type (unless name conflict)
10619+
let { base, index } = splitArray(type);
10620+
if (base === "int" && !_types["int"]) {
10621+
base = "int256";
1060410622
}
10605-
if (type === "uint" && !_types["uint"]) {
10606-
type = "uint256";
10623+
if (base === "uint" && !_types["uint"]) {
10624+
base = "uint256";
1060710625
}
10608-
return { name, type };
10626+
return { name, type: (base + (index || "")) };
1060910627
});
1061010628
links.set(type, new Set());
1061110629
parents.set(type, []);
@@ -10619,7 +10637,7 @@ class TypedDataEncoder {
1061910637
assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", _types);
1062010638
uniqueNames.add(field.name);
1062110639
// Get the base type (drop any array specifiers)
10622-
const baseType = (field.type.match(/^([^\x5b]*)(\x5b|$)/))[1] || null;
10640+
const baseType = splitArray(field.type).base;
1062310641
assertArgument(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", _types);
1062410642
// Is this a base encoding type?
1062510643
const encoder = getBaseEncoder(baseType);
@@ -10682,12 +10700,12 @@ class TypedDataEncoder {
1068210700
}
1068310701
}
1068410702
// Array
10685-
const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
10686-
if (match) {
10687-
const subtype = match[1];
10703+
const array = splitArray(type).array;
10704+
if (array) {
10705+
const subtype = array.prefix;
1068810706
const subEncoder = this.getEncoder(subtype);
1068910707
return (value) => {
10690-
assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value);
10708+
assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value);
1069110709
let result = value.map(subEncoder);
1069210710
if (this.#fullTypes.has(subtype)) {
1069310711
result = result.map(keccak256);
@@ -10757,10 +10775,10 @@ class TypedDataEncoder {
1075710775
}
1075810776
}
1075910777
// Array
10760-
const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
10761-
if (match) {
10762-
assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value);
10763-
return value.map((v) => this._visit(match[1], v, callback));
10778+
const array = splitArray(type).array;
10779+
if (array) {
10780+
assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value);
10781+
return value.map((v) => this._visit(array.prefix, v, callback));
1076410782
}
1076510783
// Struct
1076610784
const fields = this.types[type];

dist/ethers.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ethers.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ethers.umd.js

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10558,6 +10558,23 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
1055810558
function encodeType(name, fields) {
1055910559
return `${name}(${fields.map(({ name, type }) => (type + " " + name)).join(",")})`;
1056010560
}
10561+
// foo[][3] => { base: "foo", index: "[][3]", array: {
10562+
// base: "foo", prefix: "foo[]", count: 3 } }
10563+
function splitArray(type) {
10564+
const match = type.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);
10565+
if (match) {
10566+
return {
10567+
base: match[1],
10568+
index: (match[2] + match[4]),
10569+
array: {
10570+
base: match[1],
10571+
prefix: (match[1] + match[2]),
10572+
count: (match[5] ? parseInt(match[5]) : -1),
10573+
}
10574+
};
10575+
}
10576+
return { base: type };
10577+
}
1056110578
/**
1056210579
* A **TypedDataEncode** prepares and encodes [[link-eip-712]] payloads
1056310580
* for signed typed data.
@@ -10603,15 +10620,16 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
1060310620
const subtypes = new Map();
1060410621
const types = {};
1060510622
Object.keys(_types).forEach((type) => {
10606-
// Normalize int/uint unless they are a complex type themselves
1060710623
types[type] = _types[type].map(({ name, type }) => {
10608-
if (type === "int" && !_types["int"]) {
10609-
type = "int256";
10624+
// Normalize the base type (unless name conflict)
10625+
let { base, index } = splitArray(type);
10626+
if (base === "int" && !_types["int"]) {
10627+
base = "int256";
1061010628
}
10611-
if (type === "uint" && !_types["uint"]) {
10612-
type = "uint256";
10629+
if (base === "uint" && !_types["uint"]) {
10630+
base = "uint256";
1061310631
}
10614-
return { name, type };
10632+
return { name, type: (base + (index || "")) };
1061510633
});
1061610634
links.set(type, new Set());
1061710635
parents.set(type, []);
@@ -10625,7 +10643,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
1062510643
assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", _types);
1062610644
uniqueNames.add(field.name);
1062710645
// Get the base type (drop any array specifiers)
10628-
const baseType = (field.type.match(/^([^\x5b]*)(\x5b|$)/))[1] || null;
10646+
const baseType = splitArray(field.type).base;
1062910647
assertArgument(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", _types);
1063010648
// Is this a base encoding type?
1063110649
const encoder = getBaseEncoder(baseType);
@@ -10688,12 +10706,12 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
1068810706
}
1068910707
}
1069010708
// Array
10691-
const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
10692-
if (match) {
10693-
const subtype = match[1];
10709+
const array = splitArray(type).array;
10710+
if (array) {
10711+
const subtype = array.prefix;
1069410712
const subEncoder = this.getEncoder(subtype);
1069510713
return (value) => {
10696-
assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value);
10714+
assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value);
1069710715
let result = value.map(subEncoder);
1069810716
if (this.#fullTypes.has(subtype)) {
1069910717
result = result.map(keccak256);
@@ -10763,10 +10781,10 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
1076310781
}
1076410782
}
1076510783
// Array
10766-
const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
10767-
if (match) {
10768-
assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value);
10769-
return value.map((v) => this._visit(match[1], v, callback));
10784+
const array = splitArray(type).array;
10785+
if (array) {
10786+
assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value);
10787+
return value.map((v) => this._visit(array.prefix, v, callback));
1077010788
}
1077110789
// Struct
1077210790
const fields = this.types[type];

dist/ethers.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ethers.umd.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib.commonjs/_tests/test-hash-typeddata.js

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib.commonjs/_tests/test-hash-typeddata.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)