UNPKG

1.14 kBPlain TextView Raw
1import { makeErrorWithCode } from '@neo-one/utils-esnext-esm';
2
3// tslint:disable-next-line export-name
4export const ReceiveMessageTimeoutError = makeErrorWithCode(
5 'RECEIVE_MESSAGE_TIMEOUT',
6 (endpoint: string) => `Message with endpoint ${endpoint} timed out.`,
7);
8export const InvalidActionTypeError = makeErrorWithCode(
9 'INVALID_ACTION_TYPE',
10 (type: number) => `Expected action type, found: ${type}`,
11);
12export const InvalidScriptContainerTypeError = makeErrorWithCode(
13 'INVALID_SCRIPT_CONTAINER_TYPE',
14 (value: number) => `Expected ScriptContainerType, found: ${value.toString(16)}`,
15);
16export const VerifyError = makeErrorWithCode(
17 'VERIFY',
18 (reason?: string) => `Verification failed${reason === undefined ? '.' : `: ${reason}`}`,
19);
20export const InvalidConsensusMessageTypeError = makeErrorWithCode(
21 'INVALID_CONSENSUS_MESSAGE_TYPE',
22 (value: number) => `Expected ConsensusMessageType, found: ${value.toString(16)}`,
23);
24export const UnsignedBlockError = makeErrorWithCode(
25 'UNSIGNED_BLOCK',
26 (stringHash: string) => `Block script does not exist because it has not been signed. @ block with hash ${stringHash}`,
27);
28
\No newline at end of file