Skip to content

Commit

Permalink
Update dependencies. (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssuangchen authored Apr 6, 2024
1 parent 42b5ff1 commit 8f33f3a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 19 deletions.
7 changes: 3 additions & 4 deletions explorer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ edition = "2021"


[dependencies]
poem = "1.3.36"
poem-openapi = { version = "1.3.30", features = ["swagger-ui"] }
module = { path = "../module" }
poem = "3.0.0"
poem-openapi = { version = "5.0.0", features = ["swagger-ui"] }
tokio = { version = "1.0", features = ["full"] }
toml = "0.8.12"
anyhow = "1.0.52"
Expand All @@ -27,6 +26,6 @@ sha3 = { version = "0.10.4", default-features = false }
hex = "0.4.3"

zei = { git = "https://github.com/FindoraNetwork/zei", branch = "stable-main" }

module = { path = "../module" }
scanner = {path = "../scanner"}

8 changes: 4 additions & 4 deletions module/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ anyhow = "1.0.52"
toml = "0.8.12"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
poem-openapi = {version = "1.2.30"}
poem-openapi = { version = "5.0.0" }
rlp = { version = "0.5", default-features = false }
ethereum-types = "0.14.1"
ethereum = { version = "0.15.0", default-features = false, features = ["with-serde"] }
sha3 = { version = "0.8", default-features = false }
sha3 = { version = "0.10.8", default-features = false }
hex = "0.4.3"
libsecp256k1 = { version = "0.5", features = ["static-context", "hmac"] }
libsecp256k1 = { version = "0.7.1", features = ["static-context", "hmac"] }
ruc = "1.0"
base64 = "0.10"
base64 = "0.22.0"
bech32 = "0.7.2"

zei = { git = "https://github.com/FindoraNetwork/zei", branch = "stable-main" }
15 changes: 7 additions & 8 deletions module/src/utils/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub fn recover_signer(transaction: &LegacyTransaction) -> Option<H160> {

let pubkey = secp256k1_ecdsa_recover(&sig, &msg).ok()?;
Some(H160::from(H256::from_slice(
Keccak256::digest(&pubkey).as_slice(),
Keccak256::digest(pubkey).as_slice(),
)))
}

Expand Down Expand Up @@ -47,6 +47,7 @@ pub fn bech32enc<T: AsRef<[u8]> + ToBase32>(input: &T) -> String {
mod test {
use super::*;
use crate::schema::EvmTx;
use base64::{engine, Engine};
use ruc::{d, RucResult};
use zei::serialization::ZeiFromToBytes;
use zei::xfr::sig::XfrPublicKey;
Expand All @@ -63,13 +64,11 @@ mod test {

#[test]
fn test_convert_base64_to_bech32() {
let pk = base64::decode_config(
"HZnxwPI5PD_xpQX1NqKTHXqPdHXVXtGe7yQ0JI3MVTs=",
base64::URL_SAFE,
)
.c(d!())
.and_then(|bytes| XfrPublicKey::zei_from_bytes(&bytes).c(d!()))
.unwrap();
let pk = engine::general_purpose::URL_SAFE
.decode("HZnxwPI5PD_xpQX1NqKTHXqPdHXVXtGe7yQ0JI3MVTs=")
.c(d!())
.and_then(|bytes| XfrPublicKey::zei_from_bytes(&bytes).c(d!()))
.unwrap();
let addr = bech32enc(&XfrPublicKey::zei_to_bytes(&pk));
assert_eq!(
addr,
Expand Down
2 changes: 1 addition & 1 deletion prismer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
sqlx = { version = "0.6.0", features = ["runtime-tokio-rustls", "postgres", "chrono", "json"] }
sqlx = { version = "0.7.4", features = ["runtime-tokio-rustls", "postgres", "chrono", "json"] }
reqwest = { version = "0.12.3", default-features = false, features = ["json", "rustls-tls"] }
ruc = "1.0"
base64 = "0.22.0"
Expand Down
2 changes: 1 addition & 1 deletion scanner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ path = "src/bin/scanner.rs"
[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
sqlx = { version = "0.6.0", features = ["runtime-tokio-rustls", "postgres", "chrono", "json"] }
sqlx = { version = "0.7.4", features = ["runtime-tokio-rustls", "postgres", "chrono", "json"] }
reqwest = { version = "0.12.3", default-features = false, features = ["json", "rustls-tls"] }
ethereum-types = "0.14.1"
ethereum = { version = "0.15.0", default-features = false, features = ["with-serde"] }
Expand Down
2 changes: 1 addition & 1 deletion scanner/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ impl Migrate {

let mut cursor =
sqlx::query("SELECT tx_hash,block_hash,height,timestamp,ty,value FROM transaction")
.fetch(&mut conn);
.fetch(&mut *conn);
while let Some(row) = cursor.try_next().await? {
let tx: String = row.try_get("tx_hash")?;
let block: String = row.try_get("block_hash")?;
Expand Down

0 comments on commit 8f33f3a

Please sign in to comment.