1111import org .tron .common .zksnark .merkle .IncrementalMerkleTreeContainer ;
1212import org .tron .common .zksnark .merkle .MerkleContainer ;
1313import org .tron .common .zksnark .zen .Librustzcash ;
14+ import org .tron .common .zksnark .zen .hash .HashShieldedTransaction ;
1415import org .tron .core .Wallet ;
1516import org .tron .core .capsule .AccountCapsule ;
1617import org .tron .core .capsule .BytesCapsule ;
18+ import org .tron .core .capsule .TransactionCapsule ;
1719import org .tron .core .capsule .TransactionResultCapsule ;
1820import org .tron .core .db .Manager ;
1921import org .tron .core .exception .BalanceInsufficientException ;
2830@ Slf4j (topic = "actuator" )
2931public class ShieldedTransferActuator extends AbstractActuator {
3032
31- ShieldedTransferActuator (Any contract , Manager dbManager ) {
33+ private TransactionCapsule tx ;
34+
35+ ShieldedTransferActuator (Any contract , Manager dbManager , TransactionCapsule tx ) {
3236 super (contract , dbManager );
37+ this .tx = tx ;
3338 }
3439
3540 boolean isTransparentOut = false ;
@@ -109,6 +114,7 @@ private void executeShielded(List<SpendDescription> spends, List<ReceiveDescript
109114
110115 @ Override
111116 public boolean validate () throws ContractValidateException {
117+ System .out .println ("000000009999999" );
112118 if (this .contract == null ) {
113119 throw new ContractValidateException ("No contract!" );
114120 }
@@ -122,8 +128,10 @@ public boolean validate() throws ContractValidateException {
122128 }
123129
124130 ShieldedTransferContract shieldedTransferContract ;
131+ byte [] signHash ;
125132 try {
126133 shieldedTransferContract = contract .unpack (ShieldedTransferContract .class );
134+ signHash = HashShieldedTransaction .hash (tx );
127135 } catch (InvalidProtocolBufferException e ) {
128136 logger .debug (e .getMessage (), e );
129137 throw new ContractValidateException (e .getMessage ());
@@ -134,8 +142,6 @@ public boolean validate() throws ContractValidateException {
134142 return false ;
135143 }
136144
137- byte [] signHash = new byte [32 ];
138- // TODO generate signhash
139145 List <SpendDescription > spendDescriptions = shieldedTransferContract .getSpendDescriptionList ();
140146 // check duplicate sapling nullifiers
141147 if (CollectionUtils .isNotEmpty (spendDescriptions )) {
0 commit comments