-
Notifications
You must be signed in to change notification settings - Fork 23
/
event_definition.ts
68 lines (57 loc) · 1.81 KB
/
event_definition.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { ASTNode } from "../../ast_node";
import { ParameterList } from "../meta/parameter_list";
import { StructuredDocumentation } from "../meta/structured_documentation";
import { ContractDefinition } from "./contract_definition";
export class EventDefinition extends ASTNode {
/**
* The hash of the signature of the event is one of the topics
* except if you set `anonymous`.
*/
anonymous: boolean;
/**
* The name of the event
*/
name: string;
/**
* The source range for name string
*/
nameLocation?: string;
/**
* Optional documentation appearing above the event definition:
* - Is `undefined` when not specified.
* - Is type of `string` when specified and compiler version is older than `0.6.3`.
* - Is instance of `StructuredDocumentation` when specified and compiler version is `0.6.3` or newer.
*/
documentation?: string | StructuredDocumentation;
/**
* A list of values that is passed on to the EVM logging facility
*/
vParameters: ParameterList;
constructor(
id: number,
src: string,
anonymous: boolean,
name: string,
parameters: ParameterList,
documentation?: string | StructuredDocumentation,
nameLocation?: string,
raw?: any
) {
super(id, src, raw);
this.anonymous = anonymous;
this.name = name;
this.documentation = documentation;
this.nameLocation = nameLocation;
this.vParameters = parameters;
this.acceptChildren();
}
get children(): readonly ASTNode[] {
return this.pickNodes(this.documentation, this.vParameters);
}
/**
* Reference to its scoped contract
*/
get vScope(): ContractDefinition {
return this.parent as ContractDefinition;
}
}