This repository has been archived by the owner on Jan 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* check autopay instruction add to < 100% * autopay safety feature, abort on user deny autopay instruction * patch autopay checking balance, patch IS_CI global * rename validator universe tx scripts * add error codes to validator universe join
- Loading branch information
1 parent
1732c79
commit b854b44
Showing
25 changed files
with
211 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
//! Key derivation for 0L. | ||
use libra_types::{transaction::authenticator::AuthenticationKey, account_address::AccountAddress}; | ||
use libra_wallet::{Mnemonic, WalletLibrary, key_factory::{ChildNumber, ExtendedPrivKey}}; | ||
|
||
/// The key derivation used throughout 0L for configuration of validators and miners. Depended on by config/management for genesis. | ||
// #[derive(Debug)] | ||
pub struct KeyScheme { | ||
/// Owner key, the main key where funds are kept | ||
pub child_0_owner: ExtendedPrivKey, | ||
/// Operator of node | ||
pub child_1_operator: ExtendedPrivKey, | ||
/// Validator network identity | ||
pub child_2_val_network: ExtendedPrivKey, | ||
/// Fullnode network identity | ||
pub child_3_fullnode_network: ExtendedPrivKey, | ||
/// Consensus key | ||
pub child_4_consensus: ExtendedPrivKey, | ||
/// Execution key | ||
pub child_5_executor: ExtendedPrivKey, | ||
} | ||
|
||
impl KeyScheme { | ||
/// Generates the necessary private keys for validator and full node set up. | ||
pub fn new(wallet: &WalletLibrary) -> Self { | ||
let kf = wallet.get_key_factory(); | ||
Self { | ||
child_0_owner: kf.private_child(ChildNumber::new(0)).unwrap(), | ||
child_1_operator: kf.private_child(ChildNumber::new(1)).unwrap(), | ||
child_2_val_network: kf.private_child(ChildNumber::new(2)).unwrap(), | ||
child_3_fullnode_network: kf.private_child(ChildNumber::new(3)).unwrap(), | ||
child_4_consensus: kf.private_child(ChildNumber::new(4)).unwrap(), | ||
child_5_executor: kf.private_child(ChildNumber::new(5)).unwrap(), | ||
} | ||
} | ||
/// Get KeyScheme from a mnemonic string. | ||
pub fn new_from_mnemonic(mnemonic: String) -> KeyScheme { | ||
let wallet = WalletLibrary::new_from_mnemonic(Mnemonic::from(&mnemonic).unwrap()); | ||
KeyScheme::new(&wallet) | ||
} | ||
/// Returns the default owner address given the key derivation. | ||
pub fn derived_address(&self) -> AccountAddress { | ||
let staged_owner_auth_key = AuthenticationKey::ed25519(&self.child_0_owner.get_public()); | ||
staged_owner_auth_key.derived_address() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-316 Bytes
language/stdlib/compiled/transaction_scripts/abi/ol_join_validator_set.abi
Binary file not shown.
Binary file removed
BIN
-175 Bytes
language/stdlib/compiled/transaction_scripts/abi/ol_remove_self_validator_universe.abi
Binary file not shown.
Binary file added
BIN
+375 Bytes
language/stdlib/compiled/transaction_scripts/abi/ol_validator_universe_join.abi
Binary file not shown.
Binary file added
BIN
+169 Bytes
language/stdlib/compiled/transaction_scripts/abi/ol_validator_universe_leave.abi
Binary file not shown.
Binary file removed
BIN
-306 Bytes
language/stdlib/compiled/transaction_scripts/ol_join_validator_set.mv
Binary file not shown.
Binary file added
BIN
+365 Bytes
language/stdlib/compiled/transaction_scripts/ol_validator_universe_join.mv
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.