1313import org .tron .core .capsule .TransactionCapsule ;
1414import org .tron .p2p .utils .ByteArray ;
1515import org .tron .protos .Protocol ;
16- import org .tron .protos .contract .AssetIssueContractOuterClass ;
1716import org .tron .protos .contract .BalanceContract ;
1817import org .tron .protos .contract .Common ;
19- import org .tron .protos .contract .SmartContractOuterClass ;
2018
2119public class TransactionLogTriggerCapsuleTest {
2220
2321 private static final String OWNER_ADDRESS = "41548794500882809695a8a687866e76d4271a1abc" ;
2422 private static final String RECEIVER_ADDRESS = "41abd4b9367799eaa3197fecb144eb71de1e049150" ;
25- private static final String CONTRACT_ADDRESS = "A0B4750E2CD76E19DCA331BF5D089B71C3C2798548" ;
2623
2724 public TransactionCapsule transactionCapsule ;
2825 public BlockCapsule blockCapsule ;
@@ -178,70 +175,4 @@ public void testConstructorWithCancelAllUnfreezeTrxCapsule() {
178175 triggerCapsule .getTransactionLogTrigger ().getExtMap ().get (BANDWIDTH .name ()).longValue ());
179176 }
180177
181- @ Test
182- public void testConstructorWithTransferCapsule () {
183- BalanceContract .TransferContract .Builder builder2 =
184- BalanceContract .TransferContract .newBuilder ()
185- .setOwnerAddress (ByteString .copyFrom (ByteArray .fromHexString (OWNER_ADDRESS )))
186- .setToAddress (ByteString .copyFrom (ByteArray .fromHexString (RECEIVER_ADDRESS )));
187- transactionCapsule = new TransactionCapsule (builder2 .build (),
188- Protocol .Transaction .Contract .ContractType .TransferContract );
189-
190- TransactionLogTriggerCapsule triggerCapsule =
191- new TransactionLogTriggerCapsule (transactionCapsule , blockCapsule );
192-
193- Assert .assertNotNull (triggerCapsule .getTransactionLogTrigger ().getFromAddress ());
194- Assert .assertNotNull (triggerCapsule .getTransactionLogTrigger ().getToAddress ());
195- }
196-
197- @ Test
198- public void testConstructorWithTransferAssetCapsule () {
199- AssetIssueContractOuterClass .TransferAssetContract .Builder builder2 =
200- AssetIssueContractOuterClass .TransferAssetContract .newBuilder ()
201- .setAssetName (ByteString .copyFrom ("AssetName" .getBytes ()))
202- .setOwnerAddress (ByteString .copyFrom (ByteArray .fromHexString (OWNER_ADDRESS )))
203- .setToAddress (ByteString .copyFrom (ByteArray .fromHexString (RECEIVER_ADDRESS )));
204- transactionCapsule = new TransactionCapsule (builder2 .build (),
205- Protocol .Transaction .Contract .ContractType .TransferAssetContract );
206-
207- TransactionLogTriggerCapsule triggerCapsule =
208- new TransactionLogTriggerCapsule (transactionCapsule , blockCapsule );
209-
210- Assert .assertNotNull (triggerCapsule .getTransactionLogTrigger ().getFromAddress ());
211- Assert .assertNotNull (triggerCapsule .getTransactionLogTrigger ().getToAddress ());
212- }
213-
214- @ Test
215- public void testConstructorWithTriggerSmartContract () {
216- SmartContractOuterClass .TriggerSmartContract .Builder builder2 =
217- SmartContractOuterClass .TriggerSmartContract .newBuilder ()
218- .setOwnerAddress (ByteString .copyFrom (ByteArray .fromHexString (OWNER_ADDRESS )))
219- .setContractAddress (ByteString .copyFrom (ByteArray .fromHexString (CONTRACT_ADDRESS )));
220- transactionCapsule = new TransactionCapsule (builder2 .build (),
221- Protocol .Transaction .Contract .ContractType .TriggerSmartContract );
222-
223- TransactionLogTriggerCapsule triggerCapsule =
224- new TransactionLogTriggerCapsule (transactionCapsule , blockCapsule );
225-
226- Assert .assertNotNull (triggerCapsule .getTransactionLogTrigger ().getFromAddress ());
227- Assert .assertNotNull (triggerCapsule .getTransactionLogTrigger ().getToAddress ());
228- }
229-
230- @ Test
231- public void testConstructorWithCreateSmartContract () {
232- SmartContractOuterClass .CreateSmartContract .Builder builder2 =
233- SmartContractOuterClass .CreateSmartContract .newBuilder ()
234- .setOwnerAddress (ByteString .copyFrom (ByteArray .fromHexString (OWNER_ADDRESS )));
235- transactionCapsule = new TransactionCapsule (builder2 .build (),
236- Protocol .Transaction .Contract .ContractType .CreateSmartContract );
237-
238- TransactionLogTriggerCapsule triggerCapsule =
239- new TransactionLogTriggerCapsule (transactionCapsule , blockCapsule );
240-
241- Assert .assertNotNull (triggerCapsule .getTransactionLogTrigger ().getFromAddress ());
242- }
243-
244-
245-
246-
247178}
0 commit comments