* add new packages * `@0x/protocol-utils`: Update with latest code from `@0x/contracs-zero-ex` + misc stuff * @0x/contracts-zero-ex`: Switch to using `@0x/protocol-utils` in most places * @0x/protocol-types`: Delete this package. * regen yarn lock * `@0x/contracts-zero-ex`: Unpin `@0x/protocol-utils` dep. * `@0x/contracts-integrations`: Fix borken test * update changelogs * `@0x/protocol-utils`: Update deps * `@0x/protocol-utils`: add tests * `@0x/protocol-utils`: More tests * `@0x/protocol-utils`: Update readme. * update deps * run prettier * `@0x/contract-artifacts`: Regenerate artifacts * `@0x/contract-wrappers`: Regenerate wrappers * `@0x/protocol-utils`: Update changelog * `@0x/contract-wrappers`: Export stuff for doc gen * `@0x/protocol-utils`: Use `Web3Wrapper.signTypedDataV4Async()` for MM compatibility. * upgrade org deps Co-authored-by: Lawrence Forman <me@merklejerk.com>
27 lines
652 B
TypeScript
27 lines
652 B
TypeScript
import { RevertError } from '@0x/utils';
|
|
|
|
export enum SignatureValidationErrorCodes {
|
|
AlwaysInvalid = 0,
|
|
InvalidLength = 1,
|
|
Unsupported = 2,
|
|
Illegal = 3,
|
|
WrongSigner = 4,
|
|
BadSignatureData = 5,
|
|
}
|
|
|
|
export class SignatureValidationError extends RevertError {
|
|
constructor(code?: SignatureValidationErrorCodes, hash?: string) {
|
|
super('SignatureValidationError', 'SignatureValidationError(uint8 code, bytes32 hash)', {
|
|
code,
|
|
hash,
|
|
});
|
|
}
|
|
}
|
|
|
|
const types = [SignatureValidationError];
|
|
|
|
// Register the types we've defined.
|
|
for (const type of types) {
|
|
RevertError.registerType(type);
|
|
}
|