Skip to content
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
2 changes: 1 addition & 1 deletion packages/sdk-platforms/rust/zksync-sso/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ alloy = { version = "0.11.0", default-features = false, features = [
"contract",
"eip712",
] }
alloy-zksync = { git = "https://github.com/jackpooleyml/alloy-zksync", rev = "e96bb14e3ca6c3a8031e59494cf05fcedd12f07a" }
alloy-zksync = { version = "0.11.0" }

# Http
url = "2.5.4"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
use crate::config::Config;
use alloy::{
consensus::SignableTransaction,
eips::Encodable2718,
network::TransactionBuilder,
primitives::{Bytes, PrimitiveSignature, U256},
};
use alloy_zksync::{
network::{
transaction_request::TransactionRequest,
tx_envelope::TxEnvelope,
unsigned_tx::eip712::{Eip712Meta, TxEip712},
Zksync,
},
Expand Down Expand Up @@ -131,14 +134,16 @@ pub async fn populate_tx_request(
Ok(tx)
}

pub fn build_raw_tx(tx: TransactionRequest) -> eyre::Result<Vec<u8>> {
pub(crate) fn build_raw_tx(tx: TransactionRequest) -> eyre::Result<Vec<u8>> {
let tx_eip712: TxEip712 = TransactionRequestWrapper(tx).into();
let out = {
let mut out = Vec::new();
let dummy_signature_bytes = vec![0; 65];
let dummy_signature: PrimitiveSignature =
dummy_signature_bytes.as_slice().try_into()?;
tx_eip712.encode_with_signature(&dummy_signature, &mut out);
let signed_tx = tx_eip712.into_signed(dummy_signature);
let envelope = TxEnvelope::Eip712(signed_tx);
envelope.encode_2718(&mut out);
out
};
println!(
Expand Down
Loading