Skip to content

Commit 4d754c2

Browse files
authored
Merge pull request #2631 from tronprotocol/develop
merge develop code
2 parents 92bae1e + b0e0483 commit 4d754c2

File tree

93 files changed

+795
-720
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+795
-720
lines changed

actuator/src/main/java/org/tron/core/actuator/AccountPermissionUpdateActuator.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.google.protobuf.ByteString;
66
import com.google.protobuf.InvalidProtocolBufferException;
77
import java.util.List;
8+
import java.util.Objects;
89
import lombok.extern.slf4j.Slf4j;
910
import org.apache.commons.lang3.StringUtils;
1011
import org.tron.common.utils.Commons;
@@ -31,7 +32,12 @@ public AccountPermissionUpdateActuator() {
3132
}
3233

3334
@Override
34-
public boolean execute(TransactionResultCapsule result) throws ContractExeException {
35+
public boolean execute(Object object) throws ContractExeException {
36+
TransactionResultCapsule result = (TransactionResultCapsule)object;
37+
if (Objects.isNull(result)){
38+
throw new RuntimeException("TransactionResultCapsule is null");
39+
}
40+
3541
AccountStore accountStore = chainBaseManager.getAccountStore();
3642
long fee = calcFee();
3743
final AccountPermissionUpdateContract accountPermissionUpdateContract;

actuator/src/main/java/org/tron/core/actuator/AssetIssueActuator.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.util.ArrayList;
2121
import java.util.Iterator;
2222
import java.util.List;
23+
import java.util.Objects;
2324
import lombok.extern.slf4j.Slf4j;
2425
import org.tron.common.utils.Commons;
2526
import org.tron.core.capsule.AccountCapsule;
@@ -47,7 +48,12 @@ public AssetIssueActuator() {
4748
}
4849

4950
@Override
50-
public boolean execute(TransactionResultCapsule ret) throws ContractExeException {
51+
public boolean execute(Object result) throws ContractExeException {
52+
TransactionResultCapsule ret = (TransactionResultCapsule)result;
53+
if (Objects.isNull(ret)){
54+
throw new RuntimeException("TransactionResultCapsule is null");
55+
}
56+
5157
long fee = calcFee();
5258
DynamicPropertiesStore dynamicStore = chainBaseManager.getDynamicPropertiesStore();
5359
AssetIssueStore assetIssueStore = chainBaseManager.getAssetIssueStore();

actuator/src/main/java/org/tron/core/actuator/ClearABIContractActuator.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.google.protobuf.ByteString;
44
import com.google.protobuf.InvalidProtocolBufferException;
55
import java.util.Arrays;
6+
import java.util.Objects;
67
import lombok.extern.slf4j.Slf4j;
78
import org.tron.common.utils.Commons;
89
import org.tron.common.utils.StringUtil;
@@ -26,7 +27,12 @@ public ClearABIContractActuator() {
2627
}
2728

2829
@Override
29-
public boolean execute(TransactionResultCapsule ret) throws ContractExeException {
30+
public boolean execute(Object result) throws ContractExeException {
31+
TransactionResultCapsule ret = (TransactionResultCapsule)result;
32+
if (Objects.isNull(ret)){
33+
throw new RuntimeException("TransactionResultCapsule is null");
34+
}
35+
3036
long fee = calcFee();
3137
ContractStore contractStore = chainBaseManager.getContractStore();
3238
try {

actuator/src/main/java/org/tron/core/actuator/CreateAccountActuator.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.google.protobuf.ByteString;
44
import com.google.protobuf.InvalidProtocolBufferException;
5+
import java.util.Objects;
56
import lombok.extern.slf4j.Slf4j;
67
import org.tron.common.utils.Commons;
78
import org.tron.common.utils.StringUtil;
@@ -24,8 +25,13 @@ public CreateAccountActuator() {
2425
}
2526

2627
@Override
27-
public boolean execute(TransactionResultCapsule ret)
28+
public boolean execute(Object result)
2829
throws ContractExeException {
30+
TransactionResultCapsule ret = (TransactionResultCapsule)result;
31+
if (Objects.isNull(ret)){
32+
throw new RuntimeException("TransactionResultCapsule is null");
33+
}
34+
2935
long fee = calcFee();
3036
DynamicPropertiesStore dynamicStore = chainBaseManager.getDynamicPropertiesStore();
3137
AccountStore accountStore = chainBaseManager.getAccountStore();

actuator/src/main/java/org/tron/core/actuator/ExchangeCreateActuator.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.google.protobuf.ByteString;
44
import com.google.protobuf.InvalidProtocolBufferException;
55
import java.util.Arrays;
6+
import java.util.Objects;
67
import lombok.extern.slf4j.Slf4j;
78
import org.tron.common.utils.Commons;
89
import org.tron.common.utils.StringUtil;
@@ -30,7 +31,12 @@ public ExchangeCreateActuator() {
3031
}
3132

3233
@Override
33-
public boolean execute(TransactionResultCapsule ret) throws ContractExeException {
34+
public boolean execute(Object object) throws ContractExeException {
35+
TransactionResultCapsule ret = (TransactionResultCapsule)object;
36+
if (Objects.isNull(ret)){
37+
throw new RuntimeException("TransactionResultCapsule is null");
38+
}
39+
3440
long fee = calcFee();
3541
AccountStore accountStore = chainBaseManager.getAccountStore();
3642
DynamicPropertiesStore dynamicStore = chainBaseManager.getDynamicPropertiesStore();

actuator/src/main/java/org/tron/core/actuator/ExchangeInjectActuator.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.google.protobuf.InvalidProtocolBufferException;
55
import java.math.BigInteger;
66
import java.util.Arrays;
7+
import java.util.Objects;
78
import lombok.extern.slf4j.Slf4j;
89
import org.tron.common.utils.ByteArray;
910
import org.tron.common.utils.Commons;
@@ -32,7 +33,12 @@ public ExchangeInjectActuator() {
3233
}
3334

3435
@Override
35-
public boolean execute(TransactionResultCapsule ret) throws ContractExeException {
36+
public boolean execute(Object object) throws ContractExeException {
37+
TransactionResultCapsule ret = (TransactionResultCapsule)object;
38+
if (Objects.isNull(ret)){
39+
throw new RuntimeException("TransactionResultCapsule is null");
40+
}
41+
3642
long fee = calcFee();
3743
AccountStore accountStore = chainBaseManager.getAccountStore();
3844
DynamicPropertiesStore dynamicStore = chainBaseManager.getDynamicPropertiesStore();

actuator/src/main/java/org/tron/core/actuator/ExchangeTransactionActuator.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.google.protobuf.ByteString;
44
import com.google.protobuf.InvalidProtocolBufferException;
55
import java.util.Arrays;
6+
import java.util.Objects;
67
import lombok.extern.slf4j.Slf4j;
78
import org.tron.common.utils.ByteArray;
89
import org.tron.common.utils.Commons;
@@ -31,7 +32,12 @@ public ExchangeTransactionActuator() {
3132
}
3233

3334
@Override
34-
public boolean execute(TransactionResultCapsule ret) throws ContractExeException {
35+
public boolean execute(Object object) throws ContractExeException {
36+
TransactionResultCapsule ret = (TransactionResultCapsule)object;
37+
if (Objects.isNull(ret)){
38+
throw new RuntimeException("TransactionResultCapsule is null");
39+
}
40+
3541
long fee = calcFee();
3642
AccountStore accountStore = chainBaseManager.getAccountStore();
3743
DynamicPropertiesStore dynamicStore = chainBaseManager.getDynamicPropertiesStore();

actuator/src/main/java/org/tron/core/actuator/ExchangeWithdrawActuator.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.math.BigDecimal;
66
import java.math.BigInteger;
77
import java.util.Arrays;
8+
import java.util.Objects;
89
import lombok.extern.slf4j.Slf4j;
910
import org.tron.common.utils.ByteArray;
1011
import org.tron.common.utils.Commons;
@@ -33,7 +34,12 @@ public ExchangeWithdrawActuator() {
3334
}
3435

3536
@Override
36-
public boolean execute(TransactionResultCapsule ret) throws ContractExeException {
37+
public boolean execute(Object object) throws ContractExeException {
38+
TransactionResultCapsule ret = (TransactionResultCapsule)object;
39+
if (Objects.isNull(ret)){
40+
throw new RuntimeException("TransactionResultCapsule is null");
41+
}
42+
3743
long fee = calcFee();
3844
AccountStore accountStore = chainBaseManager.getAccountStore();
3945
DynamicPropertiesStore dynamicStore = chainBaseManager.getDynamicPropertiesStore();

actuator/src/main/java/org/tron/core/actuator/FreezeBalanceActuator.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.google.protobuf.InvalidProtocolBufferException;
55
import java.util.Arrays;
66
import java.util.List;
7+
import java.util.Objects;
78
import lombok.extern.slf4j.Slf4j;
89
import org.apache.commons.lang3.ArrayUtils;
910
import org.tron.common.utils.Commons;
@@ -32,7 +33,12 @@ public FreezeBalanceActuator() {
3233
}
3334

3435
@Override
35-
public boolean execute(TransactionResultCapsule ret) throws ContractExeException {
36+
public boolean execute(Object result) throws ContractExeException {
37+
TransactionResultCapsule ret = (TransactionResultCapsule)result;
38+
if (Objects.isNull(ret)){
39+
throw new RuntimeException("TransactionResultCapsule is null");
40+
}
41+
3642
long fee = calcFee();
3743
final FreezeBalanceContract freezeBalanceContract;
3844
AccountStore accountStore = chainBaseManager.getAccountStore();

actuator/src/main/java/org/tron/core/actuator/ParticipateAssetIssueActuator.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import com.google.protobuf.ByteString;
1919
import com.google.protobuf.InvalidProtocolBufferException;
2020
import java.util.Arrays;
21+
import java.util.Objects;
2122
import lombok.extern.slf4j.Slf4j;
2223
import org.tron.common.utils.ByteArray;
2324
import org.tron.common.utils.Commons;
@@ -43,7 +44,12 @@ public ParticipateAssetIssueActuator() {
4344
}
4445

4546
@Override
46-
public boolean execute(TransactionResultCapsule ret) throws ContractExeException {
47+
public boolean execute(Object object) throws ContractExeException {
48+
TransactionResultCapsule ret = (TransactionResultCapsule)object;
49+
if (Objects.isNull(ret)){
50+
throw new RuntimeException("TransactionResultCapsule is null");
51+
}
52+
4753
long fee = calcFee();
4854
AccountStore accountStore = chainBaseManager.getAccountStore();
4955
DynamicPropertiesStore dynamicStore = chainBaseManager.getDynamicPropertiesStore();

actuator/src/main/java/org/tron/core/actuator/ProposalApproveActuator.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import com.google.protobuf.ByteString;
99
import com.google.protobuf.InvalidProtocolBufferException;
10+
import java.util.Objects;
1011
import lombok.extern.slf4j.Slf4j;
1112
import org.tron.common.utils.ByteArray;
1213
import org.tron.common.utils.Commons;
@@ -33,7 +34,12 @@ public ProposalApproveActuator() {
3334
}
3435

3536
@Override
36-
public boolean execute(TransactionResultCapsule ret) throws ContractExeException {
37+
public boolean execute(Object result) throws ContractExeException {
38+
TransactionResultCapsule ret = (TransactionResultCapsule)result;
39+
if (Objects.isNull(ret)){
40+
throw new RuntimeException("TransactionResultCapsule is null");
41+
}
42+
3743
long fee = calcFee();
3844
ProposalStore proposalStore = chainBaseManager.getProposalStore();
3945
try {

actuator/src/main/java/org/tron/core/actuator/ProposalCreateActuator.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.google.protobuf.ByteString;
88
import com.google.protobuf.InvalidProtocolBufferException;
99
import java.util.Map;
10+
import java.util.Objects;
1011
import lombok.extern.slf4j.Slf4j;
1112
import org.tron.common.utils.Commons;
1213
import org.tron.common.utils.DBConfig;
@@ -28,7 +29,12 @@ public ProposalCreateActuator() {
2829
}
2930

3031
@Override
31-
public boolean execute(TransactionResultCapsule ret) throws ContractExeException {
32+
public boolean execute(Object result) throws ContractExeException {
33+
TransactionResultCapsule ret = (TransactionResultCapsule)result;
34+
if (Objects.isNull(ret)){
35+
throw new RuntimeException("TransactionResultCapsule is null");
36+
}
37+
3238
long fee = calcFee();
3339

3440
try {

actuator/src/main/java/org/tron/core/actuator/ProposalDeleteActuator.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import com.google.protobuf.ByteString;
88
import com.google.protobuf.InvalidProtocolBufferException;
9+
import java.util.Objects;
910
import lombok.extern.slf4j.Slf4j;
1011
import org.tron.common.utils.ByteArray;
1112
import org.tron.common.utils.Commons;
@@ -31,7 +32,12 @@ public ProposalDeleteActuator() {
3132
}
3233

3334
@Override
34-
public boolean execute(TransactionResultCapsule ret) throws ContractExeException {
35+
public boolean execute(Object result) throws ContractExeException {
36+
TransactionResultCapsule ret = (TransactionResultCapsule)result;
37+
if (Objects.isNull(ret)){
38+
throw new RuntimeException("TransactionResultCapsule is null");
39+
}
40+
3541
long fee = calcFee();
3642
ProposalStore proposalStore = chainBaseManager.getProposalStore();
3743
try {

actuator/src/main/java/org/tron/core/actuator/SetAccountIdActuator.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.google.protobuf.ByteString;
44
import com.google.protobuf.InvalidProtocolBufferException;
5+
import java.util.Objects;
56
import lombok.extern.slf4j.Slf4j;
67
import org.tron.common.utils.Commons;
78
import org.tron.core.capsule.AccountCapsule;
@@ -23,7 +24,12 @@ public SetAccountIdActuator() {
2324
}
2425

2526
@Override
26-
public boolean execute(TransactionResultCapsule ret) throws ContractExeException {
27+
public boolean execute(Object result) throws ContractExeException {
28+
TransactionResultCapsule ret = (TransactionResultCapsule)result;
29+
if (Objects.isNull(ret)){
30+
throw new RuntimeException("TransactionResultCapsule is null");
31+
}
32+
2733
final SetAccountIdContract setAccountIdContract;
2834
final long fee = calcFee();
2935
AccountStore accountStore = chainBaseManager.getAccountStore();

actuator/src/main/java/org/tron/core/actuator/ShieldedTransferActuator.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.util.Arrays;
99
import java.util.HashSet;
1010
import java.util.List;
11+
import java.util.Objects;
1112
import lombok.extern.slf4j.Slf4j;
1213
import org.apache.commons.collections4.CollectionUtils;
1314
import org.tron.common.utils.Commons;
@@ -53,8 +54,13 @@ public ShieldedTransferActuator() {
5354
}
5455

5556
@Override
56-
public boolean execute(TransactionResultCapsule ret)
57+
public boolean execute(Object result)
5758
throws ContractExeException {
59+
TransactionResultCapsule ret = (TransactionResultCapsule)result;
60+
if (Objects.isNull(ret)){
61+
throw new RuntimeException("TransactionResultCapsule is null");
62+
}
63+
5864
long fee = 0;
5965
long shieldedTransactionFee = calcFee();
6066
AccountStore accountStore = chainBaseManager.getAccountStore();

actuator/src/main/java/org/tron/core/actuator/TransferActuator.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.google.protobuf.ByteString;
66
import com.google.protobuf.InvalidProtocolBufferException;
77
import java.util.Arrays;
8+
import java.util.Objects;
89
import lombok.extern.slf4j.Slf4j;
910
import org.tron.common.utils.Commons;
1011
import org.tron.core.capsule.AccountCapsule;
@@ -27,7 +28,12 @@ public TransferActuator() {
2728
}
2829

2930
@Override
30-
public boolean execute(TransactionResultCapsule ret) throws ContractExeException {
31+
public boolean execute(Object object) throws ContractExeException {
32+
TransactionResultCapsule ret = (TransactionResultCapsule)object;
33+
if (Objects.isNull(ret)){
34+
throw new RuntimeException("TransactionResultCapsule is null");
35+
}
36+
3137
long fee = calcFee();
3238
AccountStore accountStore = chainBaseManager.getAccountStore();
3339
DynamicPropertiesStore dynamicStore = chainBaseManager.getDynamicPropertiesStore();

actuator/src/main/java/org/tron/core/actuator/TransferAssetActuator.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.google.protobuf.InvalidProtocolBufferException;
2020
import java.util.Arrays;
2121
import java.util.Map;
22+
import java.util.Objects;
2223
import lombok.extern.slf4j.Slf4j;
2324
import org.tron.common.utils.ByteArray;
2425
import org.tron.common.utils.Commons;
@@ -44,7 +45,12 @@ public TransferAssetActuator() {
4445
}
4546

4647
@Override
47-
public boolean execute(TransactionResultCapsule ret) throws ContractExeException {
48+
public boolean execute(Object result) throws ContractExeException {
49+
TransactionResultCapsule ret = (TransactionResultCapsule)result;
50+
if (Objects.isNull(ret)){
51+
throw new RuntimeException("TransactionResultCapsule is null");
52+
}
53+
4854
long fee = calcFee();
4955
AccountStore accountStore = chainBaseManager.getAccountStore();
5056
DynamicPropertiesStore dynamicStore = chainBaseManager.getDynamicPropertiesStore();

actuator/src/main/java/org/tron/core/actuator/UnfreezeAssetActuator.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.google.protobuf.InvalidProtocolBufferException;
66
import java.util.Iterator;
77
import java.util.List;
8+
import java.util.Objects;
89
import lombok.extern.slf4j.Slf4j;
910
import org.tron.common.utils.Commons;
1011
import org.tron.common.utils.StringUtil;
@@ -28,7 +29,12 @@ public UnfreezeAssetActuator() {
2829
}
2930

3031
@Override
31-
public boolean execute(TransactionResultCapsule ret) throws ContractExeException {
32+
public boolean execute(Object object) throws ContractExeException {
33+
TransactionResultCapsule ret = (TransactionResultCapsule)object;
34+
if (Objects.isNull(ret)){
35+
throw new RuntimeException("TransactionResultCapsule is null");
36+
}
37+
3238
long fee = calcFee();
3339
AccountStore accountStore = chainBaseManager.getAccountStore();
3440
AssetIssueStore assetIssueStore = chainBaseManager.getAssetIssueStore();

0 commit comments

Comments
 (0)