Skip to content

Commit ed0b559

Browse files
authored
Merge pull request #394 from tronprotocol/feature/update_for_solidity0.6
update for solidity0.6.0
2 parents 1278de3 + 7cdac87 commit ed0b559

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

src/main/java/org/tron/walletcli/Client.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2198,7 +2198,10 @@ private void triggerContract(String[] parameters, boolean isConstant)
21982198
if (tokenId.equalsIgnoreCase("#")) {
21992199
tokenId = "";
22002200
}
2201-
byte[] input = Hex.decode(AbiUtil.parseMethod(methodStr, argsStr, isHex));
2201+
byte[] input = new byte[0];
2202+
if (!methodStr.equalsIgnoreCase("#")) {
2203+
input = Hex.decode(AbiUtil.parseMethod(methodStr, argsStr, isHex));
2204+
}
22022205
byte[] contractAddress = WalletApi.decodeFromBase58Check(contractAddrStr);
22032206

22042207
boolean result = walletApiWrapper

src/main/java/org/tron/walletserver/WalletApi.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,6 +1693,8 @@ public static SmartContract.ABI.Entry.EntryType getEntryType(String type) {
16931693
return SmartContract.ABI.Entry.EntryType.Event;
16941694
case "fallback":
16951695
return SmartContract.ABI.Entry.EntryType.Fallback;
1696+
case "receive":
1697+
return SmartContract.ABI.Entry.EntryType.Receive;
16961698
default:
16971699
return SmartContract.ABI.Entry.EntryType.UNRECOGNIZED;
16981700
}
@@ -1767,11 +1769,12 @@ public static SmartContract.ABI jsonStr2ABI(String jsonStr) {
17671769
System.out.println("No type!");
17681770
return null;
17691771
}
1770-
if (!type.equalsIgnoreCase("fallback") && null == inputs) {
1771-
System.out.println("No inputs!");
1772-
return null;
1772+
if(inputs == null) {
1773+
if(!(type.equalsIgnoreCase("fallback") || type.equalsIgnoreCase("receive"))) {
1774+
logger.error("No inputs!");
1775+
return null;
1776+
}
17731777
}
1774-
17751778
SmartContract.ABI.Entry.Builder entryBuilder = SmartContract.ABI.Entry.newBuilder();
17761779
entryBuilder.setAnonymous(anonymous);
17771780
entryBuilder.setConstant(constant);

src/main/protos/core/contract/smart_contract.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ message SmartContract {
1717
Function = 2;
1818
Event = 3;
1919
Fallback = 4;
20+
Receive = 5;
2021
}
2122
message Param {
2223
bool indexed = 1;

0 commit comments

Comments
 (0)