Skip to content

Commit

Permalink
Force Log properties to be non-optional (#415).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Apr 4, 2020
1 parent 053a2d7 commit da412f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
12 changes: 5 additions & 7 deletions packages/abstract-provider/src.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,19 @@ export interface BlockWithTransactions extends _Block {


export interface Log {
blockNumber?: number;
blockHash?: string;
transactionIndex?: number;
blockNumber: number;
blockHash: string;
transactionIndex: number;

removed: boolean;

transactionLogIndex?: number,

address: string;
data: string;

topics: Array<string>;

transactionHash?: string;
logIndex?: number;
transactionHash: string;
logIndex: number;
}

export interface TransactionReceipt {
Expand Down
11 changes: 2 additions & 9 deletions packages/providers/src.ts/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export class Formatter {
};

formats.receiptLog = {
transactionLogIndex: Formatter.allowNull(number),
transactionIndex: number,
blockNumber: number,
transactionHash: hash,
Expand Down Expand Up @@ -381,18 +380,12 @@ export class Formatter {
}

receipt(value: any): TransactionReceipt {
//let status = transactionReceipt.status;
//let root = transactionReceipt.root;

const result: TransactionReceipt = Formatter.check(this.formats.receipt, value);
result.logs.forEach((entry, index) => {
if (entry.transactionLogIndex == null) {
entry.transactionLogIndex = index;
}
});

if (value.status != null) {
result.byzantium = true;
}

return result;
}

Expand Down

0 comments on commit da412f6

Please sign in to comment.