Skip to content

Commit

Permalink
remove AWS/Ledger/GCP/... wallets & fix errors during build
Browse files Browse the repository at this point in the history
  • Loading branch information
error2215 committed Jun 25, 2024
1 parent 42a2efc commit 60bf9aa
Show file tree
Hide file tree
Showing 67 changed files with 453 additions and 2,344 deletions.
14 changes: 5 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ alloy-rpc-types-trace = { version = "0.1.0", default-features = false, path = "c
alloy-rpc-types = { version = "0.1.0", default-features = false, path = "crates/rpc-types" }
alloy-serde = { version = "0.1.0", default-features = false, path = "crates/serde" }
alloy-signer = { version = "0.1.0", default-features = false, path = "crates/signer" }
alloy-signer-aws = { version = "0.1.0", default-features = false, path = "crates/signer-aws" }
alloy-signer-gcp = { version = "0.1.0", default-features = false, path = "crates/signer-gcp" }
alloy-signer-ledger = { version = "0.1.0", default-features = false, path = "crates/signer-ledger" }
alloy-signer-trezor = { version = "0.1.0", default-features = false, path = "crates/signer-trezor" }
alloy-signer-wallet = { version = "0.1.0", default-features = false, path = "crates/signer-wallet" }
alloy-transport = { version = "0.1.0", default-features = false, path = "crates/transport" }
alloy-transport-http = { version = "0.1.0", default-features = false, path = "crates/transport-http" }
Expand All @@ -47,11 +43,11 @@ alloy-transport-ws = { version = "0.1.0", default-features = false, path = "crat

test-utils = { version = "0.1.0", default-features = false, path = "crates/internal-test-utils", package = "alloy-internal-test-utils" }

alloy-core = { git = "https://github.com/core-coin/base-rs.git",default-features = false }
alloy-dyn-abi = { git = "https://github.com/core-coin/base-rs.git", default-features = false }
alloy-json-abi = { git = "https://github.com/core-coin/base-rs.git", default-features = false }
alloy-primitives = { git = "https://github.com/core-coin/base-rs.git",default-features = false}
alloy-sol-types = { git = "https://github.com/core-coin/base-rs.git", default-features = false }
alloy-core = { git = "https://github.com/core-coin/base-rs.git",default-features = false, rev = "9b507d9faa54d87ca0ef930ffb9a36993390b1e6" }
alloy-dyn-abi = { git = "https://github.com/core-coin/base-rs.git", default-features = false, rev = "9b507d9faa54d87ca0ef930ffb9a36993390b1e6" }
alloy-json-abi = { git = "https://github.com/core-coin/base-rs.git", default-features = false, rev = "9b507d9faa54d87ca0ef930ffb9a36993390b1e6" }
alloy-primitives = { git = "https://github.com/core-coin/base-rs.git",default-features = false, rev = "9b507d9faa54d87ca0ef930ffb9a36993390b1e6" }
alloy-sol-types = { git = "https://github.com/core-coin/base-rs.git", default-features = false, rev = "9b507d9faa54d87ca0ef930ffb9a36993390b1e6" }

alloy-rlp = { version = "0.3", default-features = false }

Expand Down
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ This repository contains the following crates:
- [`alloy-rpc-types-engine`] - Ethereum execution-consensus layer (engine) API RPC types
- [`alloy-rpc-types-trace`] - Ethereum RPC trace types
- [`alloy-signer`] - Ethereum signer abstraction
- [`alloy-signer-aws`] - [AWS KMS] signer implementation
- [`alloy-signer-gcp`] - [GCP KMS] signer implementation
- [`alloy-signer-ledger`] - [Ledger] signer implementation
- [`alloy-signer-trezor`] - [Trezor] signer implementation
- [`alloy-signer-wallet`] - Local wallet (Keystore/Mnemonic/Yubihsm) signer implementation
- [`alloy-transport`] - Low-level Ethereum JSON-RPC transport abstraction
- [`alloy-transport-http`] - HTTP transport implementation
Expand All @@ -93,10 +89,6 @@ This repository contains the following crates:
[`alloy-rpc-types-trace`]: https://github.com/alloy-rs/alloy/tree/main/crates/rpc-types-trace
[`alloy-rpc-types`]: https://github.com/alloy-rs/alloy/tree/main/crates/rpc-types
[`alloy-signer`]: https://github.com/alloy-rs/alloy/tree/main/crates/signer
[`alloy-signer-aws`]: https://github.com/alloy-rs/alloy/tree/main/crates/signer-aws
[`alloy-signer-gcp`]: https://github.com/alloy-rs/alloy/tree/main/crates/signer-gcp
[`alloy-signer-ledger`]: https://github.com/alloy-rs/alloy/tree/main/crates/signer-ledger
[`alloy-signer-trezor`]: https://github.com/alloy-rs/alloy/tree/main/crates/signer-trezor
[`alloy-signer-wallet`]: https://github.com/alloy-rs/alloy/tree/main/crates/signer-wallet
[`alloy-transport`]: https://github.com/alloy-rs/alloy/tree/main/crates/transport
[`alloy-transport-http`]: https://github.com/alloy-rs/alloy/tree/main/crates/transport-http
Expand Down
13 changes: 0 additions & 13 deletions crates/alloy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ alloy-serde = { workspace = true, default-features = false, optional = true }

# signer
alloy-signer = { workspace = true, default-features = false, optional = true }
alloy-signer-aws = { workspace = true, default-features = false, optional = true }
alloy-signer-gcp = { workspace = true, default-features = false, optional = true }
alloy-signer-ledger = { workspace = true, default-features = false, optional = true }
alloy-signer-trezor = { workspace = true, default-features = false, optional = true }
alloy-signer-wallet = { workspace = true, default-features = false, optional = true }

# transport
Expand Down Expand Up @@ -129,12 +125,6 @@ rpc-types-trace = ["rpc-types", "dep:alloy-rpc-types-trace"]

# signers
signers = ["dep:alloy-signer"]
signer-aws = ["signers", "dep:alloy-signer-aws"]
signer-gcp = ["signers", "dep:alloy-signer-gcp"]
signer-ledger = ["signers", "dep:alloy-signer-ledger"]
signer-ledger-browser = ["signer-ledger", "alloy-signer-ledger?/browser"]
signer-ledger-node = ["signer-ledger", "alloy-signer-ledger?/node"]
signer-trezor = ["signers", "dep:alloy-signer-trezor"]
signer-wallet = ["signers", "dep:alloy-signer-wallet"]
signer-keystore = ["signer-wallet", "alloy-signer-wallet?/keystore"]
signer-mnemonic = ["signer-wallet", "alloy-signer-wallet?/mnemonic"]
Expand Down Expand Up @@ -178,9 +168,6 @@ kzg = ["alloy-consensus?/kzg"]
eip712 = [
"alloy-core/eip712",
"alloy-signer?/eip712",
"alloy-signer-aws?/eip712",
"alloy-signer-gcp?/eip712",
"alloy-signer-ledger?/eip712",
# TODO: https://github.com/alloy-rs/alloy/issues/201
# "alloy-signer-trezor?/eip712",
]
10 changes: 5 additions & 5 deletions crates/consensus/src/receipt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub trait TxReceipt<T = Log> {
mod tests {
use super::*;
use alloy_eips::eip2718::Encodable2718;
use alloy_primitives::{address, b256, bytes, hex, Bytes, LogData};
use alloy_primitives::{b256, bytes, cAddress, hex, Bytes, LogData};
use alloy_rlp::{Decodable, Encodable};

// Test vector from: https://eips.ethereum.org/EIPS/eip-2481
Expand All @@ -49,7 +49,7 @@ mod tests {
receipt: Receipt {
cumulative_gas_used: 0x1u128,
logs: vec![Log {
address: address!("0000000000000000000000000000000000000011"),
address: cAddress!("00000000000000000000000000000000000000000011"),
data: LogData::new_unchecked(
vec![
b256!("000000000000000000000000000000000000000000000000000000000000dead"),
Expand Down Expand Up @@ -81,7 +81,7 @@ mod tests {
receipt: Receipt {
cumulative_gas_used: 0x1u128,
logs: vec![Log {
address: address!("0000000000000000000000000000000000000011"),
address: cAddress!("00000000000000000000000000000000000000000011"),
data: LogData::new_unchecked(
vec![
b256!("000000000000000000000000000000000000000000000000000000000000dead"),
Expand All @@ -106,7 +106,7 @@ mod tests {
status: true,
logs: vec![
Log {
address: address!("4bf56695415f725e43c3e04354b604bcfb6dfb6e"),
address: cAddress!("00004bf56695415f725e43c3e04354b604bcfb6dfb6e"),
data: LogData::new_unchecked(
vec![b256!(
"c69dc3d7ebff79e41f525be431d5cd3cc08f80eaf0f7819054a726eeb7086eb9"
Expand All @@ -115,7 +115,7 @@ mod tests {
),
},
Log {
address: address!("faca325c86bf9c2d5b413cd7b90b209be92229c2"),
address: cAddress!("0000faca325c86bf9c2d5b413cd7b90b209be92229c2"),
data: LogData::new_unchecked(
vec![b256!(
"8cca58667b1e9ffa004720ac99a3d61a138181963b294d270d91c53d36402ae2"
Expand Down
2 changes: 1 addition & 1 deletion crates/consensus/src/transaction/eip1559.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{SignableTransaction, Signed, Transaction, TxType};
// use alloy_eips::eip2930::AccessList;
use alloy_primitives::{sha3, Bytes, ChainId, Signature, TxKind, U256};
use alloy_primitives::{sha3, Bytes, ChainId, TxKind, Signature, U256};
use alloy_rlp::{BufMut, Decodable, Encodable, Header};
use core::mem;

Expand Down
10 changes: 6 additions & 4 deletions crates/consensus/src/transaction/eip2930.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,11 @@ impl Decodable for TxEip2930 {

#[cfg(test)]
mod tests {
use core::str::FromStr;

use super::TxEip2930;
use crate::{SignableTransaction, TxEnvelope};
use alloy_primitives::{Address, Bytes, Signature, TxKind, U256};
use alloy_primitives::{Address, Bytes, IcanAddress, TxKind, Signature, U256};
use alloy_rlp::{Decodable, Encodable};

#[test]
Expand All @@ -326,7 +328,7 @@ mod tests {
input: Bytes::from(vec![1, 2]),
// access_list: Default::default(),
};
let signature = Signature::test_signature();
let signature = Signature::from_str("0x").unwrap();

let mut encoded = Vec::new();
tx.encode_with_signature_fields(&signature, &mut encoded);
Expand All @@ -342,13 +344,13 @@ mod tests {
nonce: 0,
gas_price: 1,
gas_limit: 2,
to: Address::default().into(),
to: IcanAddress::default().into(),
value: U256::from(3_u64),
input: Bytes::from(vec![1, 2]),
// access_list: Default::default(),
};

let signature = Signature::test_signature();
let signature = Signature::from_str("0x").unwrap();

let tx = request.into_signed(signature);

Expand Down
19 changes: 8 additions & 11 deletions crates/consensus/src/transaction/eip4844.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub mod utils;
use crate::{SignableTransaction, Signed, Transaction, TxType};

use alloy_eips::{/*eip2930::AccessList, */ eip4844::DATA_GAS_PER_BLOB};
use alloy_primitives::{sha3, Address, Bytes, ChainId, Signature, TxKind, B256, U256};
use alloy_primitives::{sha3, Address, Bytes, ChainId, IcanAddress, Signature, TxKind, B256, U256};
use alloy_rlp::{length_of_length, BufMut, Decodable, Encodable, Header};
use core::mem;

Expand Down Expand Up @@ -327,7 +327,7 @@ pub struct TxEip4844 {
#[cfg_attr(feature = "serde", serde(with = "alloy_serde::u128_via_ruint"))]
pub max_priority_fee_per_gas: u128,
/// The 160-bit address of the message call’s recipient.
pub to: Address,
pub to: IcanAddress,
/// A scalar value equal to the number of Wei to
/// be transferred to the message call’s recipient or,
/// in the case of contract creation, as an endowment
Expand Down Expand Up @@ -894,13 +894,15 @@ impl Transaction for TxEip4844WithSidecar {

#[cfg(test)]
mod tests {
use core::str::FromStr;

use super::{BlobTransactionSidecar, TxEip4844, TxEip4844WithSidecar};
use crate::{SignableTransaction, TxEip4844Variant, TxEnvelope};
use alloy_eips::{
eip2930::AccessList,
eip4844::{Blob, Bytes48},
};
use alloy_primitives::{address, b256, bytes, Signature, U256};
use alloy_primitives::{address, b256, bytes, cAddress, Signature, U256};
use alloy_rlp::{Decodable, Encodable};

#[test]
Expand All @@ -926,7 +928,7 @@ mod tests {
proofs: vec![Bytes48::from([4; 48])],
};
let mut tx = TxEip4844WithSidecar { tx, sidecar };
let signature = Signature::test_signature();
let signature = Signature::from_str("0x").unwrap();

// turn this transaction into_signed
let expected_signed = tx.clone().into_signed(signature);
Expand Down Expand Up @@ -972,7 +974,7 @@ mod tests {
gas_limit: 8000000,
max_fee_per_gas: 10571233596,
max_priority_fee_per_gas: 1000000000,
to: address!("a8cb082a5a689e0d594d7da1e2d72a3d63adc1bd"),
to: cAddress!("0000a8cb082a5a689e0d594d7da1e2d72a3d63adc1bd"),
value: U256::ZERO,
// access_list: AccessList::default(),
blob_versioned_hashes: vec![
Expand All @@ -983,12 +985,7 @@ mod tests {
input: bytes!("701f58c50000000000000000000000000000000000000000000000000000000000073fb1ed12e288def5b439ea074b398dbb4c967f2852baac3238c5fe4b62b871a59a6d00000000000000000000000000000000000000000000000000000000123971da000000000000000000000000000000000000000000000000000000000000000ac39b2a24e1dbdd11a1e7bd7c0f4dfd7d9b9cfa0997d033ad05f961ba3b82c6c83312c967f10daf5ed2bffe309249416e03ee0b101f2b84d2102b9e38b0e4dfdf0000000000000000000000000000000000000000000000000000000066254c8b538dcc33ecf5334bbd294469f9d4fd084a3090693599a46d6c62567747cbc8660000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000073fb20000000000000000000000000000000000000000000000000000000066254da10000000000000000000000000000000000000000000000000000000012397d5e20b09b263779fda4171c341e720af8fa469621ff548651f8dbbc06c2d320400c000000000000000000000000000000000000000000000000000000000000000b50a833bb11af92814e99c6ff7cf7ba7042827549d6f306a04270753702d897d8fc3c411b99159939ac1c16d21d3057ddc8b2333d1331ab34c938cff0eb29ce2e43241c170344db6819f76b1f1e0ab8206f3ec34120312d275c4f5bbea7f5c55700000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000000000000000000000000031800000000000000000000000000000000000000000000800b0000000000000000000000000000000000000000000000000000000000000004ed12e288def5b439ea074b398dbb4c967f2852baac3238c5fe4b62b871a59a6d00000ca8000000000000000000000000000000000000800b000000000000000000000000000000000000000000000000000000000000000300000000000000000000000066254da100000000000000000000000066254e9d00010ca80000000000000000000000000000000000008001000000000000000000000000000000000000000000000000000000000000000550a833bb11af92814e99c6ff7cf7ba7042827549d6f306a04270753702d897d800010ca800000000000000000000000000000000000080010000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000b00010ca8000000000000000000000000000000000000801100000000000000000000000000000000000000000000000000000000000000075c1cd5bd0fd333ce9d7c8edfc79f43b8f345b4a394f6aba12a2cc78ce4012ed700010ca80000000000000000000000000000000000008011000000000000000000000000000000000000000000000000000000000000000845392775318aa47beaafbdc827da38c9f1e88c3bdcabba2cb493062e17cbf21e00010ca800000000000000000000000000000000000080080000000000000000000000000000000000000000000000000000000000000000c094e20e7ac9b433f44a5885e3bdc07e51b309aeb993caa24ba84a661ac010c100010ca800000000000000000000000000000000000080080000000000000000000000000000000000000000000000000000000000000001ab42db8f4ed810bdb143368a2b641edf242af6e3d0de8b1486e2b0e7880d431100010ca8000000000000000000000000000000000000800800000000000000000000000000000000000000000000000000000000000000022d94e4cc4525e4e2d81e8227b6172e97076431a2cf98792d978035edd6e6f3100000000000000000000000000000000000000000000000000000000000000000000000000000012101c74dfb80a80fccb9a4022b2406f79f56305e6a7c931d30140f5d372fe793837e93f9ec6b8d89a9d0ab222eeb27547f66b90ec40fbbdd2a4936b0b0c19ca684ff78888fbf5840d7c8dc3c493b139471750938d7d2c443e2d283e6c5ee9fde3765a756542c42f002af45c362b4b5b1687a8fc24cbf16532b903f7bb289728170dcf597f5255508c623ba247735538376f494cdcdd5bd0c4cb067526eeda0f4745a28d8baf8893ecc1b8cee80690538d66455294a028da03ff2add9d8a88e6ee03ba9ffe3ad7d91d6ac9c69a1f28c468f00fe55eba5651a2b32dc2458e0d14b4dd6d0173df255cd56aa01e8e38edec17ea8933f68543cbdc713279d195551d4211bed5c91f77259a695e6768f6c4b110b2158fcc42423a96dcc4e7f6fddb3e2369d00000000000000000000000000000000000000000000000000000000000000") };
let variant = TxEip4844Variant::TxEip4844(tx);

let signature = Signature::from_rs_and_parity(
b256!("6c173c3c8db3e3299f2f728d293b912c12e75243e3aa66911c2329b58434e2a4").into(),
b256!("7dd4d1c228cedc5a414a668ab165d9e888e61e4c3b44cd7daf9cdcc4cec5d6b2").into(),
false,
)
.unwrap();
let signature = Signature::from_str("0x").unwrap();

let signed = variant.into_signed(signature);
assert_eq!(
Expand Down
Loading

0 comments on commit 60bf9aa

Please sign in to comment.