Skip to content

Commit 7598d9a

Browse files
authored
chore: use upstream alloy-zksync (#95)
1 parent 0ce81b3 commit 7598d9a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/sdk-platforms/rust/zksync-sso/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ alloy = { version = "0.11.0", default-features = false, features = [
2020
"contract",
2121
"eip712",
2222
] }
23-
alloy-zksync = { git = "https://github.com/jackpooleyml/alloy-zksync", rev = "e96bb14e3ca6c3a8031e59494cf05fcedd12f07a" }
23+
alloy-zksync = { version = "0.11.0" }
2424

2525
# Http
2626
url = "2.5.4"

packages/sdk-platforms/rust/zksync-sso/crates/sdk/src/utils/manual_build_transaction/transaction_builder.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
use crate::config::Config;
22
use alloy::{
3+
consensus::SignableTransaction,
4+
eips::Encodable2718,
35
network::TransactionBuilder,
46
primitives::{Bytes, PrimitiveSignature, U256},
57
};
68
use alloy_zksync::{
79
network::{
810
transaction_request::TransactionRequest,
11+
tx_envelope::TxEnvelope,
912
unsigned_tx::eip712::{Eip712Meta, TxEip712},
1013
Zksync,
1114
},
@@ -131,14 +134,16 @@ pub async fn populate_tx_request(
131134
Ok(tx)
132135
}
133136

134-
pub fn build_raw_tx(tx: TransactionRequest) -> eyre::Result<Vec<u8>> {
137+
pub(crate) fn build_raw_tx(tx: TransactionRequest) -> eyre::Result<Vec<u8>> {
135138
let tx_eip712: TxEip712 = TransactionRequestWrapper(tx).into();
136139
let out = {
137140
let mut out = Vec::new();
138141
let dummy_signature_bytes = vec![0; 65];
139142
let dummy_signature: PrimitiveSignature =
140143
dummy_signature_bytes.as_slice().try_into()?;
141-
tx_eip712.encode_with_signature(&dummy_signature, &mut out);
144+
let signed_tx = tx_eip712.into_signed(dummy_signature);
145+
let envelope = TxEnvelope::Eip712(signed_tx);
146+
envelope.encode_2718(&mut out);
142147
out
143148
};
144149
println!(

0 commit comments

Comments
 (0)