Fixed types for Log Description.

This commit is contained in:
Richard Moore 2018-07-26 17:31:08 -04:00
parent 1d98928475
commit a1a765f6e4
No known key found for this signature in database
GPG Key ID: 525F70A6FCABC295
3 changed files with 7 additions and 4 deletions

@ -234,7 +234,8 @@ class LogDescription extends Description implements _LogDescription {
readonly name: string; readonly name: string;
readonly signature: string; readonly signature: string;
readonly topic: string; readonly topic: string;
readonly values: Array<any> readonly decode: (data: string, topics: Array<string>) => any;
readonly values: any
} }
@ -378,7 +379,7 @@ export class Interface {
name: name, name: name,
signature: func.signature, signature: func.signature,
sighash: func.sighash, sighash: func.sighash,
value: bigNumberify(tx.value || 0), value: bigNumberify(tx.value || null),
}); });
} }
} }
@ -396,6 +397,7 @@ export class Interface {
// @TODO: If anonymous, and the only method, and the input count matches, should we parse and return it? // @TODO: If anonymous, and the only method, and the input count matches, should we parse and return it?
return new LogDescription({ return new LogDescription({
decode: event.decode,
name: event.name, name: event.name,
signature: event.signature, signature: event.signature,
topic: event.topic, topic: event.topic,

@ -986,7 +986,7 @@ export class AbiCoder {
return hexlify(new CoderTuple(this.coerceFunc, coders, '_').encode(values)); return hexlify(new CoderTuple(this.coerceFunc, coders, '_').encode(values));
} }
decode(types: Array<string | ParamType>, data: Arrayish): Array<any> { decode(types: Array<string | ParamType>, data: Arrayish): any {
var coders: Array<Coder> = []; var coders: Array<Coder> = [];
types.forEach(function(type) { types.forEach(function(type) {

@ -308,10 +308,11 @@ export interface EventDescription {
} }
export interface LogDescription { export interface LogDescription {
readonly decode: (data: string, topics: Array<string>) => any;
readonly name: string; readonly name: string;
readonly signature: string; readonly signature: string;
readonly topic: string; readonly topic: string;
readonly values: Array<any> readonly values: any
} }
export interface TransactionDescription { export interface TransactionDescription {