Skip to content

Commit 92f899a

Browse files
committed
modify ammount data type
1 parent 9ae0ad0 commit 92f899a

2 files changed

Lines changed: 29 additions & 4 deletions

File tree

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

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.tron.core.actuator;
22

3-
import com.google.common.primitives.Longs;
43
import com.google.protobuf.Any;
54
import com.google.protobuf.ByteString;
65
import com.google.protobuf.InvalidProtocolBufferException;
@@ -16,6 +15,7 @@
1615
import org.tron.protos.Contract.ReceiveDescription;
1716
import org.tron.protos.Contract.ShieldedTransferContract;
1817
import org.tron.protos.Contract.SpendDescription;
18+
import org.tron.protos.Protocol.Transaction.Result.code;
1919

2020

2121
@Slf4j(topic = "actuator")
@@ -26,7 +26,32 @@ public class ShieldedTransferActuator extends AbstractActuator {
2626
}
2727

2828
@Override
29-
public boolean execute(TransactionResultCapsule result) throws ContractExeException {
29+
public boolean execute(TransactionResultCapsule ret)
30+
throws ContractExeException {
31+
32+
long fee = calcFee();
33+
34+
try {
35+
ShieldedTransferContract strx = contract.unpack(ShieldedTransferContract.class);
36+
} catch (InvalidProtocolBufferException e) {
37+
logger.debug(e.getMessage(), e);
38+
ret.setStatus(fee, code.FAILED);
39+
throw new ContractExeException(e.getMessage());
40+
}
41+
42+
return false;
43+
}
44+
45+
private boolean executeTransparentIn() {
46+
47+
return false;
48+
}
49+
50+
private boolean executeTransparentOut() {
51+
return false;
52+
}
53+
54+
private boolean executeShielded() {
3055
return false;
3156
}
3257

‎src/main/protos/core/Contract.proto‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,12 +392,12 @@ message ReceiveDescription {
392392

393393
message ShieldedTransferContract {
394394
bytes transparent_from_address = 1; // transparent address
395-
bytes from_amount = 2;
395+
int64 from_amount = 2;
396396
repeated SpendDescription spend_description = 3;
397397
repeated ReceiveDescription receive_description = 4;
398398
bytes binding_signature = 5;
399399
int64 value_balance = 6;
400400
bytes transparent_to_address = 7; // transparent address
401-
bytes to_amount = 8; // the amount to transparent to_address
401+
int64 to_amount = 8; // the amount to transparent to_address
402402
}
403403
// end shielded transaction

0 commit comments

Comments
 (0)