diff --git a/client_online.go b/client_online.go index 4028b0f..965c950 100644 --- a/client_online.go +++ b/client_online.go @@ -509,8 +509,9 @@ func (c *Client) blockTxs(ctx context.Context, height *int64) (crgtypes.BlockTra if len(blockResults.TxsResults) != len(blockInfo.Block.Txs) { return crgtypes.BlockTransactionsResponse{}, crgerrs.WrapError(crgerrs.ErrOnlineClient, "block results transactions do now match block transactions") } + // process begin and end block txs - beginBlockTx := &rosettatypes.Transaction{ + beginEndBlocksTx := &rosettatypes.Transaction{ TransactionIdentifier: &rosettatypes.TransactionIdentifier{Hash: c.converter.ToRosetta().BeginBlockTxHash(blockInfo.BlockID.Hash)}, Operations: AddOperationIndexes( nil, @@ -518,14 +519,6 @@ func (c *Client) blockTxs(ctx context.Context, height *int64) (crgtypes.BlockTra ), } - endBlockTx := &rosettatypes.Transaction{ - TransactionIdentifier: &rosettatypes.TransactionIdentifier{Hash: c.converter.ToRosetta().EndBlockTxHash(blockInfo.BlockID.Hash)}, - Operations: AddOperationIndexes( - nil, - c.converter.ToRosetta().BalanceOps(StatusTxSuccess, blockResults.FinalizeBlockEvents), - ), - } - deliverTx := make([]*rosettatypes.Transaction, len(blockInfo.Block.Txs)) // process normal txs for i, tx := range blockInfo.Block.Txs { @@ -537,9 +530,8 @@ func (c *Client) blockTxs(ctx context.Context, height *int64) (crgtypes.BlockTra } finalTxs := make([]*rosettatypes.Transaction, 0, 2+len(deliverTx)) - finalTxs = append(finalTxs, beginBlockTx) + finalTxs = append(finalTxs, beginEndBlocksTx) finalTxs = append(finalTxs, deliverTx...) - finalTxs = append(finalTxs, endBlockTx) return crgtypes.BlockTransactionsResponse{ BlockResponse: c.converter.ToRosetta().BlockResponse(blockInfo),