Skip to content

Commit 59a97f6

Browse files
authored
fix: call new hasEnoughGas method to fall back on cached value on communication failure (#188)
1 parent fdaba26 commit 59a97f6

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22

33
ibaa-chain:
4-
image: docker-regis.iex.ec/poco-chain:1.1.0-poco-v6.1.0-contracts-voucher-v1.0.0-nethermind
4+
image: docker-regis.iex.ec/poco-chain:1.2.2-poco-v6.2.0-contracts-nethermind
55
expose:
66
- "8545"
77

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# x-release-please-start-version
22
version=9.0.4
33
# x-release-please-end
4-
iexecCommonsPocoVersion=5.3.1
4+
iexecCommonsPocoVersion=5.4.0
55
iexecCommonVersion=9.2.0
66

77
nexusUser

src/main/java/com/iexec/blockchain/chain/IexecHubService.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ public TransactionReceipt waitForTxMined(final SubmittedTx submittedTx) throws I
139139
return receipt;
140140
}
141141

142-
public boolean hasEnoughGas() {
143-
return hasEnoughGas(credentials.getAddress());
144-
}
145-
146142
/**
147143
* Check if the task is defined on-chain and has the {@link ChainTaskStatus#UNSET} status.
148144
*

src/main/java/com/iexec/blockchain/command/task/initialize/TaskInitializeBlockchainService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ public TaskInitializeBlockchainService(final IexecHubService iexecHubService) {
3737

3838
@Override
3939
public boolean canSendBlockchainCommand(final TaskInitializeArgs args) {
40-
String chainTaskId = args.getChainTaskId();
40+
final String chainTaskId = args.getChainTaskId();
4141
if (!iexecHubService.hasEnoughGas()) {
42-
logError(chainTaskId, args, "task is not revealing");
42+
logError(chainTaskId, args, "insufficient gas");
4343
return false;
4444
}
4545
if (!iexecHubService.isTaskInUnsetStatusOnChain(args.getChainTaskId())) {
46-
logError(chainTaskId, args, "task is not unset");
46+
logError(chainTaskId, args, "task already exist on-chain");
4747
return false;
4848
}
4949
if (!iexecHubService.isBeforeContributionDeadline(args.getChainDealId())) {

0 commit comments

Comments
 (0)