-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dj8yf0μl
committed
Jan 25, 2024
1 parent
350ed9d
commit 9696dbb
Showing
3 changed files
with
35 additions
and
0 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
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,25 @@ | ||
use near_crypto::SecretKey; | ||
use near_ledger::NEARLedgerError; | ||
|
||
#[path = "../common/lib.rs"] | ||
mod common; | ||
|
||
fn tx(ledger_pub_key: ed25519_dalek::PublicKey) -> near_primitives::transaction::Transaction { | ||
let mut tx = common::tx_template(ledger_pub_key.clone()); | ||
let sk = SecretKey::from_seed( | ||
near_crypto::KeyType::SECP256K1, | ||
&format!("{:?}", ledger_pub_key), | ||
); | ||
let public_key = sk.public_key(); | ||
tx.actions = vec![near_primitives::transaction::Action::Stake(Box::new( | ||
near_primitives::transaction::StakeAction { | ||
stake: 1157130000000000000000000, // 1.15713 NEAR, | ||
public_key, | ||
}, | ||
))]; | ||
tx | ||
} | ||
|
||
fn main() -> Result<(), NEARLedgerError> { | ||
common::get_key_sign_and_verify_flow(tx) | ||
} |