Skip to content

Commit dc701d9

Browse files
author
neo hong
committed
add receive type
1 parent 95635f1 commit dc701d9

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

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)