chore: update mempool rejection reasons (#1615)

Signed-off-by: bestmike007 <i@bestmike007.com>
This commit is contained in:
Yuanhai He
2024-01-04 05:29:52 +08:00
committed by GitHub
parent d0a1a32bc6
commit bc1e27d247
2 changed files with 73 additions and 0 deletions

View File

@@ -366,6 +366,49 @@ export type ServerFailureNoSuchChainTipRejection = {
txid: string;
};
export type TooMuchChainingRejection = {
error: string;
reason: TxRejectedReason.TooMuchChaining;
reason_data: {
actual: number;
expected: number;
is_origin: boolean;
message: string;
principal: string;
};
txid: string;
};
export type ConflictingNonceInMempoolRejection = {
error: string;
reason: TxRejectedReason.ConflictingNonceInMempool;
reason_data?: undefined;
txid: string;
};
export type BadTransactionVersionRejection = {
error: string;
reason: TxRejectedReason.BadTransactionVersion;
reason_data?: undefined;
txid: string;
};
export type TransferRecipientCannotEqualSenderRejection = {
error: string;
reason: TxRejectedReason.TransferRecipientCannotEqualSender;
reason_data: {
recipient: string;
};
txid: string;
};
export type TransferAmountMustBePositiveRejection = {
error: string;
reason: TxRejectedReason.TransferAmountMustBePositive;
reason_data?: undefined;
txid: string;
};
export type ServerFailureDatabaseRejection = {
error: string;
reason: TxRejectedReason.ServerFailureDatabase;
@@ -375,6 +418,22 @@ export type ServerFailureDatabaseRejection = {
txid: string;
};
export type EstimatorErrorRejection = {
error: string;
reason: TxRejectedReason.EstimatorError;
reason_data: {
message: string;
};
txid: string;
};
export type TemporarilyBlacklistedRejection = {
error: string;
reason: TxRejectedReason.TemporarilyBlacklisted;
reason_data?: undefined;
txid: string;
};
export type ServerFailureOtherRejection = {
error: string;
reason: TxRejectedReason.ServerFailureOther;
@@ -408,7 +467,14 @@ export type TxBroadcastResultRejected =
| BadAddressVersionByteRejection
| NoCoinbaseViaMempoolRejection
| ServerFailureNoSuchChainTipRejection
| TooMuchChainingRejection
| ConflictingNonceInMempoolRejection
| BadTransactionVersionRejection
| TransferRecipientCannotEqualSenderRejection
| TransferAmountMustBePositiveRejection
| ServerFailureDatabaseRejection
| EstimatorErrorRejection
| TemporarilyBlacklistedRejection
| ServerFailureOtherRejection;
export type TxBroadcastResult = TxBroadcastResultOk | TxBroadcastResultRejected;

View File

@@ -252,6 +252,13 @@ export enum TxRejectedReason {
BadAddressVersionByte = 'BadAddressVersionByte',
NoCoinbaseViaMempool = 'NoCoinbaseViaMempool',
ServerFailureNoSuchChainTip = 'ServerFailureNoSuchChainTip',
TooMuchChaining = 'TooMuchChaining',
ConflictingNonceInMempool = 'ConflictingNonceInMempool',
BadTransactionVersion = 'BadTransactionVersion',
TransferRecipientCannotEqualSender = 'TransferRecipientCannotEqualSender',
TransferAmountMustBePositive = 'TransferAmountMustBePositive',
ServerFailureDatabase = 'ServerFailureDatabase',
EstimatorError = 'EstimatorError',
TemporarilyBlacklisted = 'TemporarilyBlacklisted',
ServerFailureOther = 'ServerFailureOther',
}