Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
admin: updated dist files
  • Loading branch information
ricmoo committed Jan 16, 2024
1 parent 8f99601 commit e66ce74
Show file tree
Hide file tree
Showing 18 changed files with 265 additions and 73 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Expand Up @@ -3,12 +3,12 @@ Change Log

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

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

- 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)).
- Added additional sepolia testnets ([4efef76](https://github.com/ethers-io/ethers.js/commit/4efef76e8cab0acaf1b2ba231a0148f9381bb1ee)).
- 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)).
- 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)).
- 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)).
- Better debugging output on fetch errors ([bee07a0](https://github.com/ethers-io/ethers.js/commit/bee07a0750b448a9d13c2d57014bcf27f43e2ed7)).

Expand Down
48 changes: 33 additions & 15 deletions dist/ethers.js
Expand Up @@ -10552,6 +10552,23 @@ function getBaseEncoder(type) {
function encodeType(name, fields) {
return `${name}(${fields.map(({ name, type }) => (type + " " + name)).join(",")})`;
}
// foo[][3] => { base: "foo", index: "[][3]", array: {
// base: "foo", prefix: "foo[]", count: 3 } }
function splitArray(type) {
const match = type.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);
if (match) {
return {
base: match[1],
index: (match[2] + match[4]),
array: {
base: match[1],
prefix: (match[1] + match[2]),
count: (match[5] ? parseInt(match[5]) : -1),
}
};
}
return { base: type };
}
/**
* A **TypedDataEncode** prepares and encodes [[link-eip-712]] payloads
* for signed typed data.
Expand Down Expand Up @@ -10597,15 +10614,16 @@ class TypedDataEncoder {
const subtypes = new Map();
const types = {};
Object.keys(_types).forEach((type) => {
// Normalize int/uint unless they are a complex type themselves
types[type] = _types[type].map(({ name, type }) => {
if (type === "int" && !_types["int"]) {
type = "int256";
// Normalize the base type (unless name conflict)
let { base, index } = splitArray(type);
if (base === "int" && !_types["int"]) {
base = "int256";
}
if (type === "uint" && !_types["uint"]) {
type = "uint256";
if (base === "uint" && !_types["uint"]) {
base = "uint256";
}
return { name, type };
return { name, type: (base + (index || "")) };
});
links.set(type, new Set());
parents.set(type, []);
Expand All @@ -10619,7 +10637,7 @@ class TypedDataEncoder {
assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", _types);
uniqueNames.add(field.name);
// Get the base type (drop any array specifiers)
const baseType = (field.type.match(/^([^\x5b]*)(\x5b|$)/))[1] || null;
const baseType = splitArray(field.type).base;
assertArgument(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", _types);
// Is this a base encoding type?
const encoder = getBaseEncoder(baseType);
Expand Down Expand Up @@ -10682,12 +10700,12 @@ class TypedDataEncoder {
}
}
// Array
const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
if (match) {
const subtype = match[1];
const array = splitArray(type).array;
if (array) {
const subtype = array.prefix;
const subEncoder = this.getEncoder(subtype);
return (value) => {
assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value);
assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value);
let result = value.map(subEncoder);
if (this.#fullTypes.has(subtype)) {
result = result.map(keccak256);
Expand Down Expand Up @@ -10757,10 +10775,10 @@ class TypedDataEncoder {
}
}
// Array
const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
if (match) {
assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value);
return value.map((v) => this._visit(match[1], v, callback));
const array = splitArray(type).array;
if (array) {
assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value);
return value.map((v) => this._visit(array.prefix, v, callback));
}
// Struct
const fields = this.types[type];
Expand Down
2 changes: 1 addition & 1 deletion dist/ethers.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ethers.min.js

Large diffs are not rendered by default.

48 changes: 33 additions & 15 deletions dist/ethers.umd.js
Expand Up @@ -10558,6 +10558,23 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
function encodeType(name, fields) {
return `${name}(${fields.map(({ name, type }) => (type + " " + name)).join(",")})`;
}
// foo[][3] => { base: "foo", index: "[][3]", array: {
// base: "foo", prefix: "foo[]", count: 3 } }
function splitArray(type) {
const match = type.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);
if (match) {
return {
base: match[1],
index: (match[2] + match[4]),
array: {
base: match[1],
prefix: (match[1] + match[2]),
count: (match[5] ? parseInt(match[5]) : -1),
}
};
}
return { base: type };
}
/**
* A **TypedDataEncode** prepares and encodes [[link-eip-712]] payloads
* for signed typed data.
Expand Down Expand Up @@ -10603,15 +10620,16 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
const subtypes = new Map();
const types = {};
Object.keys(_types).forEach((type) => {
// Normalize int/uint unless they are a complex type themselves
types[type] = _types[type].map(({ name, type }) => {
if (type === "int" && !_types["int"]) {
type = "int256";
// Normalize the base type (unless name conflict)
let { base, index } = splitArray(type);
if (base === "int" && !_types["int"]) {
base = "int256";
}
if (type === "uint" && !_types["uint"]) {
type = "uint256";
if (base === "uint" && !_types["uint"]) {
base = "uint256";
}
return { name, type };
return { name, type: (base + (index || "")) };
});
links.set(type, new Set());
parents.set(type, []);
Expand All @@ -10625,7 +10643,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", _types);
uniqueNames.add(field.name);
// Get the base type (drop any array specifiers)
const baseType = (field.type.match(/^([^\x5b]*)(\x5b|$)/))[1] || null;
const baseType = splitArray(field.type).base;
assertArgument(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", _types);
// Is this a base encoding type?
const encoder = getBaseEncoder(baseType);
Expand Down Expand Up @@ -10688,12 +10706,12 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
}
}
// Array
const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
if (match) {
const subtype = match[1];
const array = splitArray(type).array;
if (array) {
const subtype = array.prefix;
const subEncoder = this.getEncoder(subtype);
return (value) => {
assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value);
assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value);
let result = value.map(subEncoder);
if (this.#fullTypes.has(subtype)) {
result = result.map(keccak256);
Expand Down Expand Up @@ -10763,10 +10781,10 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
}
}
// Array
const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
if (match) {
assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value);
return value.map((v) => this._visit(match[1], v, callback));
const array = splitArray(type).array;
if (array) {
assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, "value", value);
return value.map((v) => this._visit(array.prefix, v, callback));
}
// Struct
const fields = this.types[type];
Expand Down
2 changes: 1 addition & 1 deletion dist/ethers.umd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ethers.umd.min.js

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions lib.commonjs/_tests/test-hash-typeddata.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib.commonjs/_tests/test-hash-typeddata.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e66ce74

Please sign in to comment.