Force Log properties to be non-optional (#415).
This commit is contained in:
parent
053a2d7fcd
commit
da412f6607
@ -76,21 +76,19 @@ export interface BlockWithTransactions extends _Block {
|
|||||||
|
|
||||||
|
|
||||||
export interface Log {
|
export interface Log {
|
||||||
blockNumber?: number;
|
blockNumber: number;
|
||||||
blockHash?: string;
|
blockHash: string;
|
||||||
transactionIndex?: number;
|
transactionIndex: number;
|
||||||
|
|
||||||
removed: boolean;
|
removed: boolean;
|
||||||
|
|
||||||
transactionLogIndex?: number,
|
|
||||||
|
|
||||||
address: string;
|
address: string;
|
||||||
data: string;
|
data: string;
|
||||||
|
|
||||||
topics: Array<string>;
|
topics: Array<string>;
|
||||||
|
|
||||||
transactionHash?: string;
|
transactionHash: string;
|
||||||
logIndex?: number;
|
logIndex: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TransactionReceipt {
|
export interface TransactionReceipt {
|
||||||
|
@ -86,7 +86,6 @@ export class Formatter {
|
|||||||
};
|
};
|
||||||
|
|
||||||
formats.receiptLog = {
|
formats.receiptLog = {
|
||||||
transactionLogIndex: Formatter.allowNull(number),
|
|
||||||
transactionIndex: number,
|
transactionIndex: number,
|
||||||
blockNumber: number,
|
blockNumber: number,
|
||||||
transactionHash: hash,
|
transactionHash: hash,
|
||||||
@ -381,18 +380,12 @@ export class Formatter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
receipt(value: any): TransactionReceipt {
|
receipt(value: any): TransactionReceipt {
|
||||||
//let status = transactionReceipt.status;
|
|
||||||
//let root = transactionReceipt.root;
|
|
||||||
|
|
||||||
const result: TransactionReceipt = Formatter.check(this.formats.receipt, value);
|
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) {
|
if (value.status != null) {
|
||||||
result.byzantium = true;
|
result.byzantium = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user