Skip to content

Commit adb107e

Browse files
authored
feat: design multi signature scheme system (#20)
* design multi signature scheme system * more * simplify * fmt * comments * address comments
1 parent 379ae3a commit adb107e

20 files changed

Lines changed: 1633 additions & 181 deletions

File tree

bin/testapp/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ alloy-primitives = { workspace = true }
5858
async-trait = { workspace = true }
5959
evolve_mempool = { workspace = true }
6060
evolve_tx_eth = { workspace = true }
61+
ed25519-consensus = "2.1.0"
6162
hex = "0.4"
6263

6364
[[bench]]

bin/testapp/src/eth_eoa.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub mod eth_eoa_account {
7474
expected_address: [u8; 20],
7575
env: &mut dyn Environment,
7676
) -> SdkResult<()> {
77-
let sender_address: [u8; 20] = tx.sender_address().into();
77+
let sender_address: [u8; 20] = tx.sender_address().ok_or(ERR_SENDER_MISMATCH)?.into();
7878
if sender_address != expected_address {
7979
return Err(ERR_SENDER_MISMATCH);
8080
}
@@ -144,6 +144,15 @@ pub mod eth_eoa_account {
144144
if sender_id != env.whoami() {
145145
return Err(ERR_SENDER_MISMATCH);
146146
}
147+
// Backward-compatible fallback for older validator payloads.
148+
} else if let Ok(mempool_tx) = tx.get::<TxContext>() {
149+
let sender_bytes: [u8; 20] = mempool_tx
150+
.sender_address()
151+
.ok_or(ERR_SENDER_MISMATCH)?
152+
.into();
153+
if sender_bytes != expected_address {
154+
return Err(ERR_SENDER_MISMATCH);
155+
}
147156
}
148157
// For other tx types, skip verification (test mode)
149158

0 commit comments

Comments
 (0)