Skip to content

Commit

Permalink
Fix: RPC error. (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
chinyuchan authored Oct 21, 2024
1 parent 4f18e5e commit b80519f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions evm-exporter/src/getter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl Getter for PgGetter {
.get()?
.query_one(
"SELECT balance FROM balance WHERE address = $1 AND height = $2",
&[&format!("{:?}", address), &(height as i64)],
&[&format!("{:?}", address).to_lowercase(), &(height as i64)],
)?
.get("balance"),
)?)
Expand All @@ -104,7 +104,7 @@ impl Getter for PgGetter {
.get()?
.query_one(
"SELECT nonce FROM nonce WHERE address = $1 AND height = $2",
&[&format!("{:?}", address), &(height as i64)],
&[&format!("{:?}", address).to_lowercase(), &(height as i64)],
)?
.get("nonce"),
)?)
Expand All @@ -115,7 +115,7 @@ impl Getter for PgGetter {
.get()?
.query_one(
"SELECT code FROM byte_code WHERE address = $1 AND height = $2",
&[&format!("{:?}", address), &(height as i64)],
&[&format!("{:?}", address).to_lowercase(), &(height as i64)],
)?
.get("code"),
)?)
Expand All @@ -133,7 +133,7 @@ impl Getter for PgGetter {
.get()?
.query_one(
"SELECT 1 FROM state WHERE address = $1 AND height = $2",
&[&format!("{:?}", address), &(height as i64)],
&[&format!("{:?}", address).to_lowercase(), &(height as i64)],
)?
.is_empty())
}
Expand All @@ -143,7 +143,7 @@ impl Getter for PgGetter {
.get()?
.query_one(
"SELECT value FROM state WHERE idx = $1 AND address = $2 AND height = $3",
&[&format!("{:?}", index), &format!("{:?}", address), &(height as i64)],
&[&format!("{:?}", index), &format!("{:?}", address).to_lowercase(), &(height as i64)],
)?
.get("value"),
)?)
Expand All @@ -154,7 +154,7 @@ impl Getter for PgGetter {
.get()?
.query_one(
"SELECT block_hash FROM block_info WHERE block_height = $1",
&[&height.to_string()],
&[&format!("{:?}", height)],
)?
.get("block_hash"),
)?))
Expand Down Expand Up @@ -226,7 +226,7 @@ impl Getter for PgGetter {
.get()?
.query_one(
"SELECT pending_balance FROM pending_transactions WHERE sign_address = $1",
&[&format!("{:?}", address)],
&[&format!("{:?}", address).to_lowercase()],
)?
.get("pending_balance"),
)?))
Expand All @@ -237,7 +237,7 @@ impl Getter for PgGetter {
.get()?
.query_one(
"SELECT pending_nonce FROM pending_transactions WHERE sign_address = $1",
&[&format!("{:?}", address)],
&[&format!("{:?}", address).to_lowercase()],
)?
.get("pending_nonce"),
)?))
Expand All @@ -248,7 +248,7 @@ impl Getter for PgGetter {
.get()?
.query_one(
"SELECT code FROM pending_byte_code WHERE address = $1",
&[&format!("{:?}", address)],
&[&format!("{:?}", address).to_lowercase()],
)?
.get("code"),
)?))
Expand All @@ -259,7 +259,7 @@ impl Getter for PgGetter {
.get()?
.query_one(
"SELECT value FROM pending_state WHERE address = $1 AND idx = $2",
&[&format!("{:?}", address), &format!("{:?}", index)],
&[&format!("{:?}", address).to_lowercase(), &format!("{:?}", index)],
)?
.get("value"),
)?))
Expand All @@ -281,7 +281,7 @@ impl Getter for PgGetter {
.get()?
.query_one(
"SELECT value FROM allowances WHERE owner = $1 AND spender = $2 AND height = $3",
&[&format!("{:?}", owner), &format!("{:?}", spender), &( height as i64 )],
&[&format!("{:?}", owner).to_lowercase(), &format!("{:?}", spender).to_lowercase(), &( height as i64 )],
)?
.get("value"),
)?)
Expand Down

0 comments on commit b80519f

Please sign in to comment.