|
41 | 41 | import org.tron.common.crypto.Hash; |
42 | 42 | import org.tron.common.crypto.Sha256Sm3Hash; |
43 | 43 | import org.tron.keystore.StringUtils; |
| 44 | +import org.tron.protos.contract.BalanceContract; |
44 | 45 | import org.tron.walletserver.WalletApi; |
45 | 46 | import org.tron.protos.Protocol.Block; |
46 | 47 | import org.tron.protos.Protocol.Transaction; |
@@ -581,6 +582,43 @@ public static JSONObject printTransactionToJSON(Transaction transaction, boolean |
581 | 582 | contractJson = JSONObject |
582 | 583 | .parseObject(JsonFormat.printToString(marketCancelOrderContract, selfType)); |
583 | 584 | break; |
| 585 | + // new freeze begin |
| 586 | + case FreezeBalanceV2Contract: |
| 587 | + BalanceContract.FreezeBalanceV2Contract freezeBalanceV2Contract = |
| 588 | + contractParameter.unpack(BalanceContract.FreezeBalanceV2Contract.class); |
| 589 | + contractJson = |
| 590 | + JSONObject.parseObject( |
| 591 | + JsonFormat.printToString(freezeBalanceV2Contract, selfType)); |
| 592 | + break; |
| 593 | + case UnfreezeBalanceV2Contract: |
| 594 | + BalanceContract.UnfreezeBalanceV2Contract unfreezeBalanceV2Contract = |
| 595 | + contractParameter.unpack(BalanceContract.UnfreezeBalanceV2Contract.class); |
| 596 | + contractJson = |
| 597 | + JSONObject.parseObject( |
| 598 | + JsonFormat.printToString(unfreezeBalanceV2Contract, selfType)); |
| 599 | + break; |
| 600 | + case WithdrawExpireUnfreezeContract: |
| 601 | + BalanceContract.WithdrawExpireUnfreezeContract withdrawExpireUnfreezeContract = |
| 602 | + contractParameter.unpack(BalanceContract.WithdrawExpireUnfreezeContract.class); |
| 603 | + contractJson = |
| 604 | + JSONObject.parseObject( |
| 605 | + JsonFormat.printToString(withdrawExpireUnfreezeContract, selfType)); |
| 606 | + break; |
| 607 | + case DelegateResourceContract: |
| 608 | + BalanceContract.DelegateResourceContract delegateResourceContract = |
| 609 | + contractParameter.unpack(BalanceContract.DelegateResourceContract.class); |
| 610 | + contractJson = |
| 611 | + JSONObject.parseObject( |
| 612 | + JsonFormat.printToString(delegateResourceContract, selfType)); |
| 613 | + break; |
| 614 | + case UnDelegateResourceContract: |
| 615 | + BalanceContract.UnDelegateResourceContract unDelegateResourceContract = |
| 616 | + contractParameter.unpack(BalanceContract.UnDelegateResourceContract.class); |
| 617 | + contractJson = |
| 618 | + JSONObject.parseObject( |
| 619 | + JsonFormat.printToString(unDelegateResourceContract, selfType)); |
| 620 | + break; |
| 621 | + // new freeze end |
584 | 622 | // todo add other contract |
585 | 623 | default: |
586 | 624 | } |
|
0 commit comments