Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/main/java/org/tron/walletcli/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -2198,7 +2198,10 @@ private void triggerContract(String[] parameters, boolean isConstant)
if (tokenId.equalsIgnoreCase("#")) {
tokenId = "";
}
byte[] input = Hex.decode(AbiUtil.parseMethod(methodStr, argsStr, isHex));
byte[] input = new byte[0];
if (!methodStr.equalsIgnoreCase("#")) {
input = Hex.decode(AbiUtil.parseMethod(methodStr, argsStr, isHex));
}
byte[] contractAddress = WalletApi.decodeFromBase58Check(contractAddrStr);

boolean result = walletApiWrapper
Expand Down
11 changes: 7 additions & 4 deletions src/main/java/org/tron/walletserver/WalletApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -1693,6 +1693,8 @@ public static SmartContract.ABI.Entry.EntryType getEntryType(String type) {
return SmartContract.ABI.Entry.EntryType.Event;
case "fallback":
return SmartContract.ABI.Entry.EntryType.Fallback;
case "receive":
return SmartContract.ABI.Entry.EntryType.Receive;
default:
return SmartContract.ABI.Entry.EntryType.UNRECOGNIZED;
}
Expand Down Expand Up @@ -1767,11 +1769,12 @@ public static SmartContract.ABI jsonStr2ABI(String jsonStr) {
System.out.println("No type!");
return null;
}
if (!type.equalsIgnoreCase("fallback") && null == inputs) {
System.out.println("No inputs!");
return null;
if(inputs == null) {
if(!(type.equalsIgnoreCase("fallback") || type.equalsIgnoreCase("receive"))) {
logger.error("No inputs!");
return null;
}
}

SmartContract.ABI.Entry.Builder entryBuilder = SmartContract.ABI.Entry.newBuilder();
entryBuilder.setAnonymous(anonymous);
entryBuilder.setConstant(constant);
Expand Down
1 change: 1 addition & 0 deletions src/main/protos/core/contract/smart_contract.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ message SmartContract {
Function = 2;
Event = 3;
Fallback = 4;
Receive = 5;
}
message Param {
bool indexed = 1;
Expand Down