Skip to content

Commit

Permalink
Change Mempool Status Codes to Enums
Browse files Browse the repository at this point in the history
  • Loading branch information
bugbytesinc committed Jan 11, 2023
1 parent bc3af8b commit 522ab56
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/hapi-mempool/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from "./mempool-transaction-status";
export * from "./channel-info";
export * from "./mempool-info";
export * from "./transaction-summary";
Expand Down
5 changes: 5 additions & 0 deletions packages/hapi-mempool/src/mempool-transaction-status.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export enum MempoolTransactionStatus {
Queued = 100,
Submitting = 200,
Completed = 400
}
6 changes: 4 additions & 2 deletions packages/hapi-mempool/src/transaction-info.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { ResponseCodeEnum } from "@bugbytes/hapi-proto";
import type {
EntityIdKeyString,
TimestampKeyString,
TransactionIdKeyString,
} from "@bugbytes/hapi-util";
import { MempoolTransactionStatus } from "./mempool-transaction-status";

export interface TransactionInfo {
transaction_id: TransactionIdKeyString;
node: EntityIdKeyString;
duration: number;
type: string;
status: string;
precheck_code: string | null;
status: MempoolTransactionStatus;
precheck_code: ResponseCodeEnum | -1 | -2;
signed_by: string[];
history: [
{
Expand Down
6 changes: 4 additions & 2 deletions packages/hapi-mempool/src/transaction-summary.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { ResponseCodeEnum } from "@bugbytes/hapi-proto";
import type {
EntityIdKeyString,
TransactionIdKeyString,
} from "@bugbytes/hapi-util";
import { MempoolTransactionStatus } from "./mempool-transaction-status";

export interface TransactionSummary {
transaction_id: TransactionIdKeyString;
node: EntityIdKeyString;
duration: number;
type: string;
status: string;
precheck_code: string | null;
status: MempoolTransactionStatus;
precheck_code: ResponseCodeEnum | -1 | -2;
}

0 comments on commit 522ab56

Please sign in to comment.