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

Import Address type from dependency #404

Merged
merged 2 commits into from
May 1, 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
51 changes: 12 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ bs58.workspace = true
indexmap.workspace = true
bitflags.workspace = true
enum-iterator.workspace = true
subtle = { version = "2.5" }
ethereum-types = "0.14"
async_zip = { version = "0.0.17", default-features = false, features = ["deflate", "tokio"], optional = true }
csv-async = { version = "1", features = ["tokio", "with_serde"], optional = true }
sos-vfs = { version = "0.2.2" }
aes-gcm = { version = "0.10.1", features = ["std"] }
chacha20poly1305 = { version = "0.10.1", features = ["std"] }
filetime = "0.2"
web3-signature = { version = "0.4", features = ["single-party"] }
web3-address = { version = "0.6", features = ["ethereum"] }
argon2 = { version = "0.5", features = ["std"]}
balloon-hash = { version = "0.4", features = ["std"]}
app_dirs2 = "2"
Expand Down
2 changes: 1 addition & 1 deletion crates/sdk/src/account/archive/backup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std::{

use serde::{Deserialize, Serialize};
use tokio::io::{AsyncBufRead, AsyncSeek, BufReader};
use web3_address::ethereum::Address;

use uuid::Uuid;
use walkdir::WalkDir;
Expand All @@ -20,6 +19,7 @@ use crate::{
events::{EventLogExt, FolderEventLog, WriteEvent},
identity::{Identity, MemoryIdentityFolder, PublicIdentity},
sha2::{Digest, Sha256},
signer::ecdsa::Address,
vault::{
secret::SecretId, Summary, Vault, VaultAccess, VaultId, VaultWriter,
},
Expand Down
3 changes: 1 addition & 2 deletions crates/sdk/src/account/archive/zip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ use async_zip::{
use tokio::io::{AsyncBufRead, AsyncSeek, AsyncWrite};
use tokio_util::compat::{Compat, TokioAsyncWriteCompatExt};

use web3_address::ethereum::Address;

use crate::{
constants::{ARCHIVE_MANIFEST, FILES_DIR, VAULT_EXT},
signer::ecdsa::Address,
vault::{Header as VaultHeader, Summary, VaultId},
vfs::{self, File},
Error, Result,
Expand Down
20 changes: 12 additions & 8 deletions crates/sdk/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,18 @@ pub enum Error {
#[error("no system message for key '{0}'")]
NoSysMessage(String),

/// Error generated when an address has the wrong prefix.
#[error("address must begin with 0x")]
BadAddressPrefix,

/// Invalid length, secp256k1 signatures are 65 bytes
#[error("invalid signature length, got {0}, expected 65")]
InvalidLength(usize),

/// Expected a recovery identifier.
#[error("recovery identifier is expected")]
RecoveryId,

/// Generic boxed error.
#[error(transparent)]
Boxed(#[from] Box<dyn std::error::Error + Send + Sync>),
Expand Down Expand Up @@ -526,10 +538,6 @@ pub enum Error {
#[error(transparent)]
Json(#[from] serde_json::Error),

/// Error generated by the address library.
#[error(transparent)]
Address(#[from] web3_address::Error),

/// Error generated by the crypto library.
#[error(transparent)]
ChaCha(#[from] chacha20poly1305::Error),
Expand All @@ -538,10 +546,6 @@ pub enum Error {
#[error(transparent)]
Urn(#[from] urn::Error),

/// Error generated by the signature library.
#[error(transparent)]
Signature(#[from] web3_signature::SignatureError),

/// Error generated by the password entropy library.
#[error(transparent)]
Zxcvbn(#[from] zxcvbn::ZxcvbnError),
Expand Down
Loading