Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies. #246

Merged
merged 1 commit into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading