Skip to content

Commit

Permalink
Fix: get tx by hash. (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowbeer authored Apr 8, 2024
1 parent 1909b23 commit 7b6b678
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion explorer/src/service/v1/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1346,8 +1346,9 @@ struct Output {
pub asset_type: Value,
pub public_key: Value,
}

#[allow(dead_code)]
fn wrap_evm_tx(tx: &mut TransactionResponse) -> Result<()> {
pub fn wrap_evm_tx(tx: &mut TransactionResponse) -> Result<()> {
let tx_str: String = serde_json::to_string(&tx.value).unwrap();

if tx.ty == EVM_TRANSFER {
Expand Down
2 changes: 1 addition & 1 deletion explorer/src/service/v2/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub async fn get_tx_by_hash(
) -> Result<Json<TransactionResponse>> {
let mut conn = state.pool.acquire().await.map_err(internal_error)?;

let sql_query = r#"SELECT tx_hash,block_hash,height,timestamp,ty_sub,code,log,origin,result,value
let sql_query = r#"SELECT tx_hash,block_hash,height,timestamp,ty,code,log,origin,result,value
FROM transaction WHERE tx_hash=$1"#;

let row = sqlx::query(sql_query)
Expand Down

0 comments on commit 7b6b678

Please sign in to comment.