1 | import { makeErrorWithCode } from '@neo-one/utils-esnext-esm';
|
2 |
|
3 |
|
4 | export const ReceiveMessageTimeoutError = makeErrorWithCode(
|
5 | 'RECEIVE_MESSAGE_TIMEOUT',
|
6 | (endpoint: string) => `Message with endpoint ${endpoint} timed out.`,
|
7 | );
|
8 | export const InvalidActionTypeError = makeErrorWithCode(
|
9 | 'INVALID_ACTION_TYPE',
|
10 | (type: number) => `Expected action type, found: ${type}`,
|
11 | );
|
12 | export const InvalidScriptContainerTypeError = makeErrorWithCode(
|
13 | 'INVALID_SCRIPT_CONTAINER_TYPE',
|
14 | (value: number) => `Expected ScriptContainerType, found: ${value.toString(16)}`,
|
15 | );
|
16 | export const VerifyError = makeErrorWithCode(
|
17 | 'VERIFY',
|
18 | (reason?: string) => `Verification failed${reason === undefined ? '.' : `: ${reason}`}`,
|
19 | );
|
20 | export const InvalidConsensusMessageTypeError = makeErrorWithCode(
|
21 | 'INVALID_CONSENSUS_MESSAGE_TYPE',
|
22 | (value: number) => `Expected ConsensusMessageType, found: ${value.toString(16)}`,
|
23 | );
|
24 | export 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 |