diff --git a/testutil/batch/batch_tx.go b/testutil/batch/batch_tx.go index c6fe1675..5e8360e3 100644 --- a/testutil/batch/batch_tx.go +++ b/testutil/batch/batch_tx.go @@ -101,10 +101,6 @@ func (m *Manager) EnqueueDepositWithdrawLSTTxs(batchID uint, msgType string) err stakerId, staker.Address.String(), err) } assetOpFunc := func(assetId uint, _ int64, asset Asset) error { - data, err := assetsAbi.Pack(msgType, asset.ClientChainID, PaddingAddressTo32(asset.Address), PaddingAddressTo32(staker.Address), opAmount.BigInt()) - if err != nil { - return xerrors.Errorf("EnqueueDepositWithdrawLSTTxs, error when call assetsAbi.Pack,err:%w", err) - } // get the total deposit amount before deposit or withdrawal stakerAssetInfo, err := m.QueryStakerAssetInfo(uint64(asset.ClientChainID), staker.EvmAddress().String(), asset.Address.String()) var expectedCheckValue sdkmath.Int @@ -132,7 +128,10 @@ func (m *Manager) EnqueueDepositWithdrawLSTTxs(batchID uint, msgType string) err opAmount = stakerAssetInfo.WithdrawableAmount expectedCheckValue = stakerAssetInfo.TotalDepositAmount.Sub(opAmount) } - + data, err := assetsAbi.Pack(msgType, asset.ClientChainID, PaddingAddressTo32(asset.Address), PaddingAddressTo32(staker.Address), opAmount.BigInt()) + if err != nil { + return xerrors.Errorf("EnqueueDepositWithdrawLSTTxs, error when call assetsAbi.Pack,err:%w", err) + } err = m.enqueueTxAndSaveRecord(&EnqueueTxParams{ staker: &staker, nonce: &nonce, diff --git a/testutil/batch/manager.go b/testutil/batch/manager.go index dcc2bb71..9413b878 100644 --- a/testutil/batch/manager.go +++ b/testutil/batch/manager.go @@ -226,14 +226,14 @@ func (m *Manager) GetDB() *gorm.DB { func (m *Manager) InitHelperRecord() error { helperRecord, err := LoadObjectByID[HelperRecord](m.GetDB(), SqliteDefaultStartID) - logger.Info("NewManager load helper record", "err", err, "helperRecord", helperRecord) + logger.Info("InitHelperRecord load helper record", "err", err, "helperRecord", helperRecord) batchID := uint(0) if err == nil { // increase the batch id, because we use a new batch id to avoid check error // every time the test-tool is started batchID = helperRecord.CurrentBatchID + 1 } - logger.Info("NewManager the new test batch ID is:", "batchID", batchID) + logger.Info("InitHelperRecord the new test batch ID is:", "batchID", batchID) err = SaveObject[HelperRecord](m.GetDB(), HelperRecord{CurrentBatchID: batchID, ID: SqliteDefaultStartID}) if err != nil { return xerrors.Errorf("can't init the helper record, err:%w", err) @@ -569,6 +569,12 @@ func (m *Manager) ExecuteBatchTestForType(msgType string) error { } func (m *Manager) Start() error { + if err := m.Prepare(); err != nil { + return err + } + if err := m.InitHelperRecord(); err != nil { + return err + } eg, ctx := errgroup.WithContext(m.ctx) m.ctx = ctx // send test transactions in batch diff --git a/testutil/batch/send_txs.go b/testutil/batch/send_txs.go index 45a98c4e..c6cbb811 100644 --- a/testutil/batch/send_txs.go +++ b/testutil/batch/send_txs.go @@ -136,7 +136,7 @@ func (m *Manager) SignSendEvmTxAndWait(txInfo *EvmTxInQueue) error { logger.Info(" the evm tx has been on chain but the execution is Failed", "txHash", txHash) return xerrors.Errorf("Failed evm tx receipt, txID:%s", txHash) } - logger.Info("the evm tx has been on chain successfully", "txID", txHash) + logger.Info("the evm tx has been on chain successfully", "blockNumber", receipt.BlockNumber, "txID", txHash) return nil } diff --git a/testutil/batch/tx_check.go b/testutil/batch/tx_check.go index f4680c61..796462c6 100644 --- a/testutil/batch/tx_check.go +++ b/testutil/batch/tx_check.go @@ -167,7 +167,10 @@ func (m *Manager) DepositWithdrawLSTCheck(batchID uint, msgType string) error { "asset", asset.Name, "assetAddr", asset.Address) transaction.CheckResult = Successful } else { - logger.Info("DepositWithdrawLSTCheck, the check is Failed", "txID", transaction.TxHash, + logger.Error("DepositWithdrawLSTCheck, the check is Failed", + "expectedAmount", expectedCheckAmount, + "actualAmount", res.TotalDepositAmount, + "txID", transaction.TxHash, "staker", staker.Name, "stakerAddr", staker.EvmAddress(), "asset", asset.Name, "assetAddr", asset.Address) transaction.CheckResult = Failed @@ -232,7 +235,10 @@ func (m *Manager) EvmDelegationCheck(batchID uint, msgType string) error { "operatorName", operator.Name, "operatorAddr", operator.AccAddress()) transaction.CheckResult = Successful } else { - logger.Info("EvmDelegationCheck, the check is Failed", "txID", transaction.TxHash, + logger.Error("EvmDelegationCheck, the check is Failed", + "expectedAmount", expectedCheckAmount, + "actualAmount", delegatedAmount, + "txID", transaction.TxHash, "staker", staker.Name, "stakerAddr", staker.EvmAddress(), "asset", asset.Name, "assetAddr", asset.Address, "operatorName", operator.Name, "operatorAddr", operator.AccAddress())