Skip to content

Commit

Permalink
eip712 util: remove ethers logger (#436)
Browse files Browse the repository at this point in the history
* remove ethers logger

* simplify type import
  • Loading branch information
ryanio authored Dec 7, 2023
1 parent 815df09 commit 1e26571
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/utils/eip712/defaults.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import { Logger } from "@ethersproject/logger";
import { ethers, zeroPadValue } from "ethers";

import type { TypedDataField } from "@ethersproject/abstract-signer";

const logger = new Logger("defaults");
import { ethers, zeroPadValue, TypedDataField } from "ethers";

const baseDefaults: Record<string, any> = {
integer: 0,
Expand Down Expand Up @@ -50,7 +45,7 @@ export class DefaultGetter<Types extends EIP712TypeDefinitions> {
const defaultValue = this.getDefaultValue(name);
this.defaultValues[name] = defaultValue;
if (!isNullish(defaultValue)) {
logger.throwError(
throw new Error(
`Got non-empty value for type ${name} in default generator: ${defaultValue}`,
);
}
Expand Down Expand Up @@ -107,6 +102,6 @@ export class DefaultGetter<Types extends EIP712TypeDefinitions> {
);
}

return logger.throwArgumentError(`unknown type: ${type}`, "type", type);
throw new Error(`unknown type: ${type}`);
}
}

0 comments on commit 1e26571

Please sign in to comment.