|
1 | 1 | package org.tron.core.actuator; |
2 | 2 |
|
| 3 | +import static org.tron.core.actuator.ActuatorConstant.NOT_EXIST_STR; |
| 4 | + |
3 | 5 | import com.google.protobuf.ByteString; |
4 | 6 | import com.google.protobuf.InvalidProtocolBufferException; |
5 | 7 | import java.util.Arrays; |
|
16 | 18 | import org.tron.core.store.AbiStore; |
17 | 19 | import org.tron.core.store.AccountStore; |
18 | 20 | import org.tron.core.store.ContractStore; |
19 | | -import org.tron.core.vm.config.VMConfig; |
20 | 21 | import org.tron.protos.Protocol.Transaction.Contract.ContractType; |
21 | 22 | import org.tron.protos.Protocol.Transaction.Result.code; |
22 | | -import org.tron.protos.contract.SmartContractOuterClass.SmartContract.ABI; |
23 | 23 | import org.tron.protos.contract.SmartContractOuterClass.ClearABIContract; |
24 | | - |
25 | | -import static org.tron.core.actuator.ActuatorConstant.NOT_EXIST_STR; |
| 24 | +import org.tron.protos.contract.SmartContractOuterClass.SmartContract.ABI; |
26 | 25 |
|
27 | 26 | @Slf4j(topic = "actuator") |
28 | 27 | public class ClearABIContractActuator extends AbstractActuator { |
@@ -57,17 +56,16 @@ public boolean execute(Object result) throws ContractExeException { |
57 | 56 |
|
58 | 57 | @Override |
59 | 58 | public boolean validate() throws ContractValidateException { |
60 | | - if (!VMConfig.allowTvmConstantinople()) { |
61 | | - throw new ContractValidateException( |
62 | | - "contract type error,unexpected type [ClearABIContract]"); |
63 | | - } |
64 | | - |
65 | 59 | if (this.any == null) { |
66 | 60 | throw new ContractValidateException(ActuatorConstant.CONTRACT_NOT_EXIST); |
67 | 61 | } |
68 | 62 | if (chainBaseManager == null) { |
69 | 63 | throw new ContractValidateException("No account store or contract store!"); |
70 | 64 | } |
| 65 | + if (chainBaseManager.getDynamicPropertiesStore().getAllowTvmConstantinople() == 0) { |
| 66 | + throw new ContractValidateException( |
| 67 | + "contract type error,unexpected type [ClearABIContract]"); |
| 68 | + } |
71 | 69 | AccountStore accountStore = chainBaseManager.getAccountStore(); |
72 | 70 | ContractStore contractStore = chainBaseManager.getContractStore(); |
73 | 71 | if (!this.any.is(ClearABIContract.class)) { |
|
0 commit comments