Skip to content

Commit

Permalink
fix: Fixed incorrect serialization in staking delegation commands tha…
Browse files Browse the repository at this point in the history
…t required to input amounts (#300)

Co-authored-by: Vlad Frolov <[email protected]>
  • Loading branch information
FroVolod and frol authored Feb 19, 2024
1 parent 849d8c8 commit 42a0751
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/commands/staking/delegate/stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl StakeContext {
let signer_id = previous_context.account_id.clone();
let validator_account_id: near_primitives::types::AccountId =
scope.validator_account_id.clone().into();
let amount = scope.amount.as_yoctonear();
let amount = scope.amount;

move |_network_config| {
Ok(crate::commands::PrepopulatedTransaction {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/staking/delegate/unstake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl UnstakeContext {
let signer_id = previous_context.account_id.clone();
let validator_account_id: near_primitives::types::AccountId =
scope.validator_account_id.clone().into();
let amount = scope.amount.as_yoctonear();
let amount = scope.amount;

move |_network_config| {
Ok(crate::commands::PrepopulatedTransaction {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/staking/delegate/withdraw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl WithdrawContext {
let signer_id = previous_context.account_id.clone();
let validator_account_id: near_primitives::types::AccountId =
scope.validator_account_id.clone().into();
let amount = scope.amount.as_yoctonear();
let amount = scope.amount;

move |_network_config| {
Ok(crate::commands::PrepopulatedTransaction {
Expand Down
2 changes: 2 additions & 0 deletions src/types/near_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const ONE_NEAR: u128 = 10u128.pow(24);
Default,
Clone,
Copy,
serde::Serialize,
serde::Deserialize,
derive_more::AsRef,
derive_more::From,
derive_more::Into,
Expand Down

0 comments on commit 42a0751

Please sign in to comment.