Skip to content

Commit

Permalink
Merge pull request #10 from starkbamse/eip1559-and-other-enums
Browse files Browse the repository at this point in the history
Eip1559 and other enums
  • Loading branch information
saefstroem authored May 19, 2024
2 parents 53de0e0 + 089cc65 commit 04fa698
Show file tree
Hide file tree
Showing 17 changed files with 622 additions and 1,322 deletions.
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

0 comments on commit 04fa698

Please sign in to comment.