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

Eip1559 and other enums #10

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

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
alloy = { git = "https://github.com/alloy-rs/alloy", version = "0.1.0",features=["rpc-types-eth","eips","signers","signer-wallet","consensus","network","providers","transports","transport-http","contract"] }
bincode = "1.3.3"
sled = "0.34.7"
thiserror = "1.0.59"
serde = { version="1.0.197",features=["derive"] }
sha2 = "0.10.8"
tokio = "1.37.0"
uuid = {version="1.8.0",features=["v4"]}
tokio = {version="1.37.0",features=["full"]}
reqwest = "0.12.4"
log = "0.4.21"
zeroize = {version="1.7.0",features=["zeroize_derive"]}
async-std = "1.12.0"
ethers = "2.0.14"
serde_json = "1.0.117"
crossbeam-skiplist = "0.1.3"
35 changes: 0 additions & 35 deletions src/common/mod.rs

This file was deleted.

24 changes: 23 additions & 1 deletion src/db/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
use crate::{common::DatabaseError, types::Invoice};
use sled::Tree;
use thiserror::Error;
use crate::invoice::Invoice;

#[derive(Error, Debug)]
pub enum DatabaseError {
#[error("No matches found")]
NotFound,
#[error("Could not get from database")]
Get,
#[error("Could not set to database")]
Set,
#[error("Could not communicate with database")]
Communicate,
#[error("Could not deserialize binary data")]
Deserialize,
#[error("Could not serialize binary data")]
Serialize,
#[error("Could not delete from database")]
NoDelete,
#[error("Database internal error: {0}")]
SledError(#[from] sled::Error),
}


/// Retrieve a value by key from a tree.
async fn get_from_tree(db: &Tree, key: &str) -> Result<Vec<u8>, DatabaseError> {
Expand Down
19 changes: 19 additions & 0 deletions src/gateway/errors.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use thiserror::Error;

#[derive(Error, Debug)]
pub enum GatewayError {
#[error("No matches found")]
NotFound,
#[error("Could not get from database")]
Get,
#[error("Could not set to database")]
Set,
#[error("Could not communicate with database")]
Communicate,
#[error("Could not deserialize binary data")]
Deserialize,
#[error("Could not serialize binary data")]
Serialize,
#[error("Could not delete from database")]
NoDelete,
}
Loading
Loading