@@ -165,6 +165,7 @@ pub trait TaskContext {
165
165
) -> Result < Height , TaskError > {
166
166
let retry_config = utils:: retry_config ( ) ;
167
167
168
+ let height = utils:: get_block_height ( sdk, retry_config) . await ?;
168
169
let result = match self . build_tx ( sdk) . await {
169
170
Ok ( ( tx, signing_data, tx_args) ) => {
170
171
utils:: execute_tx ( sdk, tx, signing_data, & tx_args) . await
@@ -173,16 +174,20 @@ pub trait TaskContext {
173
174
} ;
174
175
175
176
let epoch = match result {
177
+ Ok ( _) => None ,
176
178
Err ( TaskError :: Execution { height, .. } )
177
179
| Err ( TaskError :: InsufficientGas { height, .. } ) => {
178
180
utils:: wait_block_settlement ( sdk, height, retry_config) . await ;
179
- utils:: get_masp_epoch_at_height ( sdk, height, retry_config) . await ?
181
+ Some ( utils:: get_masp_epoch_at_height ( sdk, height, retry_config) . await ?)
182
+ }
183
+ Err ( _) => {
184
+ utils:: wait_block_settlement ( sdk, height + 1 , retry_config) . await ;
185
+ Some ( utils:: get_masp_epoch ( sdk, retry_config) . await ?)
180
186
}
181
- _ => utils:: get_masp_epoch ( sdk, retry_config) . await ?,
182
187
} ;
183
188
184
189
result. map_err ( |err| {
185
- if epoch == start_epoch {
190
+ if epoch == Some ( start_epoch) {
186
191
err
187
192
} else {
188
193
TaskError :: InvalidShielded {
0 commit comments