Skip to content

Commit

Permalink
Add parameter for set deposit_cli_version for mnemonic cmds (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
mksh authored Aug 8, 2024
1 parent 1069258 commit 3e4f624
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 18 deletions.
6 changes: 5 additions & 1 deletion src/cli/existing_mnemonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ pub struct ExistingMnemonicSubcommandOpts {
/// Path to a custom Eth PoS chain config
#[arg(long, visible_alias = "testnet_config")]
pub testnet_config: Option<String>,

/// A version of CLI to include into generated deposit data
#[arg(long, visible_alias = "deposit_cli_version", default_value = "2.7.0")]
pub deposit_cli_version: String,
}

impl ExistingMnemonicSubcommandOpts {
Expand Down Expand Up @@ -96,7 +100,7 @@ impl ExistingMnemonicSubcommandOpts {
chain,
self.withdrawal_credentials.clone(),
32_000_000_000,
"2.3.0".to_string(),
self.deposit_cli_version.clone(),
self.testnet_config.clone(),
)
.unwrap()
Expand Down
6 changes: 5 additions & 1 deletion src/cli/new_mnemonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ pub struct NewMnemonicSubcommandOpts {
/// Path to a custom Eth PoS chain config
#[arg(long, visible_alias = "testnet_config")]
pub testnet_config: Option<String>,

/// A version of CLI to include into generated deposit data
#[arg(long, visible_alias = "deposit_cli_version", default_value = "2.7.0")]
pub deposit_cli_version: String,
}

impl NewMnemonicSubcommandOpts {
Expand Down Expand Up @@ -86,7 +90,7 @@ impl NewMnemonicSubcommandOpts {
chain,
self.withdrawal_credentials.clone(),
32_000_000_000,
"2.3.0".to_string(),
self.deposit_cli_version.clone(),
self.testnet_config.clone(),
)
.unwrap()
Expand Down
24 changes: 12 additions & 12 deletions src/validators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ mod test {
Some(SupportedNetworks::Mainnet),
Some("0x0000000000000000000000000000000000000001".to_string()),
32_000_000_000,
"2.3.0".to_string(),
"2.7.0".to_string(),
None,
)
.unwrap(),
Expand All @@ -383,7 +383,7 @@ mod test {
Some(SupportedNetworks::Mainnet),
Some("0x0000000000000000000000000000000000000001".to_string()),
32_000_000_000,
"2.3.0".to_string(),
"2.7.0".to_string(),
None,
)
.unwrap(),
Expand All @@ -399,7 +399,7 @@ mod test {
"deposit_data_root": "f5c6b52d2ba608f0df4123e5ed051b5765a636e09d1372668e1ec074430f2279",
"fork_version": "00000000",
"network_name": "mainnet",
"deposit_cli_version": "2.3.0"
"deposit_cli_version": "2.7.0"
}
]"#).unwrap();

Expand Down Expand Up @@ -433,7 +433,7 @@ mod test {
Some(SupportedNetworks::Mainnet),
Some("0x0000000000000000000000000000000000000001".to_string()),
32_000_000_000,
"2.3.0".to_string(),
"2.7.0".to_string(),
None,
)
.unwrap(),
Expand All @@ -442,7 +442,7 @@ mod test {
Some(SupportedNetworks::Mainnet),
Some("0x0000000000000000000000000000000000000001".to_string()),
32_000_000_000,
"2.3.0".to_string(),
"2.7.0".to_string(),
None,
)
.unwrap(),
Expand All @@ -458,7 +458,7 @@ mod test {
"deposit_data_root": "f5c6b52d2ba608f0df4123e5ed051b5765a636e09d1372668e1ec074430f2279",
"fork_version": "00000000",
"network_name": "mainnet",
"deposit_cli_version": "2.3.0"
"deposit_cli_version": "2.7.0"
}
]"#).unwrap();

Expand Down Expand Up @@ -492,7 +492,7 @@ mod test {
Some(SupportedNetworks::Mainnet),
Some("0x0000000000000000000000000000000000000001".to_string()),
32_000_000_000,
"2.3.0".to_string(),
"2.7.0".to_string(),
None,
)
.unwrap(),
Expand All @@ -501,7 +501,7 @@ mod test {
Some(SupportedNetworks::Mainnet),
Some("0x0000000000000000000000000000000000000001".to_string()),
32_000_000_000,
"2.3.0".to_string(),
"2.7.0".to_string(),
None,
)
.unwrap(),
Expand Down Expand Up @@ -543,7 +543,7 @@ mod test {
Some(SupportedNetworks::Mainnet),
Some("0x0000000000000000000000000000000000000001".to_string()),
32_000_000_000,
"2.3.0".to_string(),
"2.7.0".to_string(),
None,
)
.unwrap(),
Expand All @@ -552,7 +552,7 @@ mod test {
Some(SupportedNetworks::Mainnet),
Some("0x0000000000000000000000000000000000000001".to_string()),
32_000_000_000,
"2.3.0".to_string(),
"2.7.0".to_string(),
None,
)
.unwrap(),
Expand Down Expand Up @@ -591,7 +591,7 @@ mod test {
Some(SupportedNetworks::Mainnet),
None,
32_000_000_000,
"2.3.0".to_string(),
"2.7.0".to_string(),
None,
)
.unwrap();
Expand All @@ -606,7 +606,7 @@ mod test {
"deposit_data_root": "270169ee3da4da7566daa4a29727b893bb1c6ce2f26b6c861afe6d480b3f9a7d",
"fork_version": "00000000",
"network_name": "mainnet",
"deposit_cli_version": "2.3.0"
"deposit_cli_version": "2.7.0"
}
]"#).unwrap();

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"pubkey": "8c239d313e3f4efb1ed937e7560dfaabeb6def6b88001357d5e9a3c33fdb022f7b028085c09451667f06b6b849c71ce8", "withdrawal_credentials": "0100000000000000000000000000000000000000000000000000000000000001", "amount": 32000000000, "signature": "80bb84926f6a1a89a7fea95de603b29e3c80df4606c78d2e34577e2a71dcb2a59458d3617a444eb846c0e5dc4d68e3e50c256d922db74ae4d3a03290bd8952c2b51d13b64c97b1ef4355b6f60bece0647e3bcb7ba60f8103d7ffd20f6347d052", "deposit_message_root": "2fbd8c8ae64bf60838663354422ff2004f37ddfc3a482fc29d39082b4a3903cb", "deposit_data_root": "4ef4e979a5507143fd40c16113122678e6b876d91b68e148785b691dd55bcb94", "fork_version": "00001020", "network_name": "goerli", "deposit_cli_version": "2.3.0"}, {"pubkey": "80145bdb454a8f55f7275903108f516ade8747efff0906616febb11c6e307667431ee286d1a1a919ea22739e0e7f6e9a", "withdrawal_credentials": "0100000000000000000000000000000000000000000000000000000000000001", "amount": 32000000000, "signature": "84b03b7210505a3acd8d061081832b4f8f0702de0e8621fd69a4d888cc69ff514473acc783a8db61ae2243eb478e16af1131e16514a011128d054f73b1126f2ede15609c49fcb9b397db56edb98021464a6e3fdb4e1b301159c0c038ba191342", "deposit_message_root": "f3b7eb90dfc663686ec76975c54ad12d7557c59e63fdb26eddeb8a68fb7c2711", "deposit_data_root": "9b900bb67fff83b3e13e8a78fe8442eb2ceff6d42a91d52fd5c684331d797adf", "fork_version": "00001020", "network_name": "goerli", "deposit_cli_version": "2.3.0"}, {"pubkey": "a759ea6450a376507bebc596b8e52981a70467fd7a33c6a66e45b51afb388078eb1dd7e9a751a91d65fba793ab2430fd", "withdrawal_credentials": "0100000000000000000000000000000000000000000000000000000000000001", "amount": 32000000000, "signature": "9513a225a05af2f4a14268151612cb48d9f49d7c9624023e4b6e1a437ab4bb5fa4d8374bdbf2edb0c6d0d282de133ec00e478dbf022a27cc16a90bc7c04b951ec722dca66d5cc6c050f42ba84ddf7874ffdc2b75db1f54972745fb7077f098e1", "deposit_message_root": "c40f308d03554f2f183475436014943545b2be2397376aec42b7fa5e1054481d", "deposit_data_root": "34c2aedd784eaa62a12fc7360e933f6b86372e55c9218e1c23b1c0ad5d57c823", "fork_version": "00001020", "network_name": "goerli", "deposit_cli_version": "2.3.0"}]
[{"pubkey": "8c239d313e3f4efb1ed937e7560dfaabeb6def6b88001357d5e9a3c33fdb022f7b028085c09451667f06b6b849c71ce8", "withdrawal_credentials": "0100000000000000000000000000000000000000000000000000000000000001", "amount": 32000000000, "signature": "80bb84926f6a1a89a7fea95de603b29e3c80df4606c78d2e34577e2a71dcb2a59458d3617a444eb846c0e5dc4d68e3e50c256d922db74ae4d3a03290bd8952c2b51d13b64c97b1ef4355b6f60bece0647e3bcb7ba60f8103d7ffd20f6347d052", "deposit_message_root": "2fbd8c8ae64bf60838663354422ff2004f37ddfc3a482fc29d39082b4a3903cb", "deposit_data_root": "4ef4e979a5507143fd40c16113122678e6b876d91b68e148785b691dd55bcb94", "fork_version": "00001020", "network_name": "goerli", "deposit_cli_version": "2.7.0"}, {"pubkey": "80145bdb454a8f55f7275903108f516ade8747efff0906616febb11c6e307667431ee286d1a1a919ea22739e0e7f6e9a", "withdrawal_credentials": "0100000000000000000000000000000000000000000000000000000000000001", "amount": 32000000000, "signature": "84b03b7210505a3acd8d061081832b4f8f0702de0e8621fd69a4d888cc69ff514473acc783a8db61ae2243eb478e16af1131e16514a011128d054f73b1126f2ede15609c49fcb9b397db56edb98021464a6e3fdb4e1b301159c0c038ba191342", "deposit_message_root": "f3b7eb90dfc663686ec76975c54ad12d7557c59e63fdb26eddeb8a68fb7c2711", "deposit_data_root": "9b900bb67fff83b3e13e8a78fe8442eb2ceff6d42a91d52fd5c684331d797adf", "fork_version": "00001020", "network_name": "goerli", "deposit_cli_version": "2.7.0"}, {"pubkey": "a759ea6450a376507bebc596b8e52981a70467fd7a33c6a66e45b51afb388078eb1dd7e9a751a91d65fba793ab2430fd", "withdrawal_credentials": "0100000000000000000000000000000000000000000000000000000000000001", "amount": 32000000000, "signature": "9513a225a05af2f4a14268151612cb48d9f49d7c9624023e4b6e1a437ab4bb5fa4d8374bdbf2edb0c6d0d282de133ec00e478dbf022a27cc16a90bc7c04b951ec722dca66d5cc6c050f42ba84ddf7874ffdc2b75db1f54972745fb7077f098e1", "deposit_message_root": "c40f308d03554f2f183475436014943545b2be2397376aec42b7fa5e1054481d", "deposit_data_root": "34c2aedd784eaa62a12fc7360e933f6b86372e55c9218e1c23b1c0ad5d57c823", "fork_version": "00001020", "network_name": "goerli", "deposit_cli_version": "2.7.0"}]
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"pubkey": "80145bdb454a8f55f7275903108f516ade8747efff0906616febb11c6e307667431ee286d1a1a919ea22739e0e7f6e9a", "withdrawal_credentials": "0100000000000000000000000000000000000000000000000000000000000001", "amount": 32000000000, "signature": "84b03b7210505a3acd8d061081832b4f8f0702de0e8621fd69a4d888cc69ff514473acc783a8db61ae2243eb478e16af1131e16514a011128d054f73b1126f2ede15609c49fcb9b397db56edb98021464a6e3fdb4e1b301159c0c038ba191342", "deposit_message_root": "f3b7eb90dfc663686ec76975c54ad12d7557c59e63fdb26eddeb8a68fb7c2711", "deposit_data_root": "9b900bb67fff83b3e13e8a78fe8442eb2ceff6d42a91d52fd5c684331d797adf", "fork_version": "00001020", "network_name": "goerli", "deposit_cli_version": "2.3.0"}, {"pubkey": "a759ea6450a376507bebc596b8e52981a70467fd7a33c6a66e45b51afb388078eb1dd7e9a751a91d65fba793ab2430fd", "withdrawal_credentials": "0100000000000000000000000000000000000000000000000000000000000001", "amount": 32000000000, "signature": "9513a225a05af2f4a14268151612cb48d9f49d7c9624023e4b6e1a437ab4bb5fa4d8374bdbf2edb0c6d0d282de133ec00e478dbf022a27cc16a90bc7c04b951ec722dca66d5cc6c050f42ba84ddf7874ffdc2b75db1f54972745fb7077f098e1", "deposit_message_root": "c40f308d03554f2f183475436014943545b2be2397376aec42b7fa5e1054481d", "deposit_data_root": "34c2aedd784eaa62a12fc7360e933f6b86372e55c9218e1c23b1c0ad5d57c823", "fork_version": "00001020", "network_name": "goerli", "deposit_cli_version": "2.3.0"}]
[{"pubkey": "80145bdb454a8f55f7275903108f516ade8747efff0906616febb11c6e307667431ee286d1a1a919ea22739e0e7f6e9a", "withdrawal_credentials": "0100000000000000000000000000000000000000000000000000000000000001", "amount": 32000000000, "signature": "84b03b7210505a3acd8d061081832b4f8f0702de0e8621fd69a4d888cc69ff514473acc783a8db61ae2243eb478e16af1131e16514a011128d054f73b1126f2ede15609c49fcb9b397db56edb98021464a6e3fdb4e1b301159c0c038ba191342", "deposit_message_root": "f3b7eb90dfc663686ec76975c54ad12d7557c59e63fdb26eddeb8a68fb7c2711", "deposit_data_root": "9b900bb67fff83b3e13e8a78fe8442eb2ceff6d42a91d52fd5c684331d797adf", "fork_version": "00001020", "network_name": "goerli", "deposit_cli_version": "2.7.0"}, {"pubkey": "a759ea6450a376507bebc596b8e52981a70467fd7a33c6a66e45b51afb388078eb1dd7e9a751a91d65fba793ab2430fd", "withdrawal_credentials": "0100000000000000000000000000000000000000000000000000000000000001", "amount": 32000000000, "signature": "9513a225a05af2f4a14268151612cb48d9f49d7c9624023e4b6e1a437ab4bb5fa4d8374bdbf2edb0c6d0d282de133ec00e478dbf022a27cc16a90bc7c04b951ec722dca66d5cc6c050f42ba84ddf7874ffdc2b75db1f54972745fb7077f098e1", "deposit_message_root": "c40f308d03554f2f183475436014943545b2be2397376aec42b7fa5e1054481d", "deposit_data_root": "34c2aedd784eaa62a12fc7360e933f6b86372e55c9218e1c23b1c0ad5d57c823", "fork_version": "00001020", "network_name": "goerli", "deposit_cli_version": "2.7.0"}]
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"pubkey": "8844cebb34d10e0e57f3c29ada375dafe14762ab85b2e408c3d6d55ce6d03317660bca9f2c2d17d8fbe14a2529ada1ea", "withdrawal_credentials": "0045b91b2f60b88e7392d49ae1364b55e713d06f30e563f9f99e10994b26221d", "amount": 32000000000, "signature": "97c0ad0d4f721dc53f33a399dbf0ff2cab6f679f4efdcdaa9f8bdd22cd11b5e37c12fdd2cd29369b1b907a51573a9ef60f93d768fd2d47a99b5d55fe6516a87b9090e16c42f5a8fcbf91d24883359bffb074a02d6d4d7f6c3cd04c8e09f8dc02", "deposit_message_root": "bfd9d2c616eb570ad3fd4d4caf169b88f80490d8923537474bf1f6c5cec5e56d", "deposit_data_root": "2abc7681f73a01acbc1974ab47119766bf57d94f86a72828f8875295f5bd92de", "fork_version": "00001020", "network_name": "goerli", "deposit_cli_version": "2.3.0"}]
[{"pubkey": "8844cebb34d10e0e57f3c29ada375dafe14762ab85b2e408c3d6d55ce6d03317660bca9f2c2d17d8fbe14a2529ada1ea", "withdrawal_credentials": "0045b91b2f60b88e7392d49ae1364b55e713d06f30e563f9f99e10994b26221d", "amount": 32000000000, "signature": "97c0ad0d4f721dc53f33a399dbf0ff2cab6f679f4efdcdaa9f8bdd22cd11b5e37c12fdd2cd29369b1b907a51573a9ef60f93d768fd2d47a99b5d55fe6516a87b9090e16c42f5a8fcbf91d24883359bffb074a02d6d4d7f6c3cd04c8e09f8dc02", "deposit_message_root": "bfd9d2c616eb570ad3fd4d4caf169b88f80490d8923537474bf1f6c5cec5e56d", "deposit_data_root": "2abc7681f73a01acbc1974ab47119766bf57d94f86a72828f8875295f5bd92de", "fork_version": "00001020", "network_name": "goerli", "deposit_cli_version": "2.7.0"}]
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"pubkey": "8f7c2bd57e3d314a38149c27b55d4d68620f7ca447f16d82f3a04e3b9ed100132b7b32c9d68b30024aaec7f5ed502b7c", "withdrawal_credentials": "01000000000000000000000071c7656ec7ab88b098defb751b7401b5f6d8976f", "amount": 32000000000, "signature": "855b6e27f78da24a3124927232d0e482a987c0f8199dc635559c36c26767c32e43e8785a398898f9779cf63acc31e7ec0ec81b2d4f162eec39af6fd4c2d2cab11a1e55c256ac42e4c6895d77c5e1ed28a002f128be6cf25f06ab82d43b852736", "deposit_message_root": "95b91817529cbefc8d9f7f0edc02b37622c84a0bad5c01fcccda1e09bb394572", "deposit_data_root": "5a90c1bd646f1ef4fff5b7a4a260c688b5353f09e6c732b21047665d7bde45a1", "fork_version": "00001020", "network_name": "goerli", "deposit_cli_version": "2.3.0"}]
[{"pubkey": "8f7c2bd57e3d314a38149c27b55d4d68620f7ca447f16d82f3a04e3b9ed100132b7b32c9d68b30024aaec7f5ed502b7c", "withdrawal_credentials": "01000000000000000000000071c7656ec7ab88b098defb751b7401b5f6d8976f", "amount": 32000000000, "signature": "855b6e27f78da24a3124927232d0e482a987c0f8199dc635559c36c26767c32e43e8785a398898f9779cf63acc31e7ec0ec81b2d4f162eec39af6fd4c2d2cab11a1e55c256ac42e4c6895d77c5e1ed28a002f128be6cf25f06ab82d43b852736", "deposit_message_root": "95b91817529cbefc8d9f7f0edc02b37622c84a0bad5c01fcccda1e09bb394572", "deposit_data_root": "5a90c1bd646f1ef4fff5b7a4a260c688b5353f09e6c732b21047665d7bde45a1", "fork_version": "00001020", "network_name": "goerli", "deposit_cli_version": "2.7.0"}]

0 comments on commit 3e4f624

Please sign in to comment.