@@ -28,7 +28,7 @@ class Contract extends _BcThing.BcThing {
28
28
try {
29
29
let { deployedCode, fetched } = this ;
30
30
if ( fetched ) return this . getData ( ) ;
31
- let contract = await this . setContract ( ) ;
31
+ let contract = await this . setContract ( this . block . number ) ;
32
32
if ( ! this . isNative ) {
33
33
// new contracts
34
34
if ( ! this . data . contractInterfaces ) {
@@ -70,26 +70,26 @@ class Contract extends _BcThing.BcThing {
70
70
}
71
71
}
72
72
73
- async getParser ( ) {
73
+ async getParser ( txBlockNumber ) {
74
74
try {
75
75
let { nod3, initConfig, log } = this ;
76
76
if ( ! this . parser ) {
77
77
let abi = await this . getAbi ( ) ;
78
- this . parser = new _rskContractParser . default ( { abi, nod3, initConfig, log } ) ;
78
+ this . parser = new _rskContractParser . default ( { abi, nod3, initConfig, log, txBlockNumber } ) ;
79
79
}
80
80
return this . parser ;
81
81
} catch ( err ) {
82
82
return Promise . reject ( err ) ;
83
83
}
84
84
}
85
85
86
- async setContract ( ) {
86
+ async setContract ( txBlockNumber ) {
87
87
try {
88
88
let { address, contract } = this ;
89
89
if ( contract ) return contract ;
90
90
// get abi
91
91
let abi = await this . getAbi ( ) ;
92
- let parser = await this . getParser ( ) ;
92
+ let parser = await this . getParser ( txBlockNumber ) ;
93
93
this . contract = parser . makeContract ( address , abi ) ;
94
94
return this . contract ;
95
95
} catch ( err ) {
0 commit comments