Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Maciej Wójcik committed Nov 21, 2024
1 parent 29c4667 commit 5950ef8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -974,19 +974,19 @@ fn should_distribute_rewards_after_restaking_delegated_funds() {
delegator_1_stake =
get_delegator_staked_amount(&mut builder, VALIDATOR_1.clone(), DELEGATOR_1.clone());

let updelegate_amount = U512::from(1_000_000);
let updelegate_result = builder.bidding(
let undelegate_amount = U512::from(1_000_000);
let undelegate_result = builder.bidding(
None,
protocol_version,
(*DELEGATOR_2_ADDR).into(),
AuctionMethod::Delegate {
max_delegators_per_validator: u32::MAX,
validator: VALIDATOR_1.clone(),
delegator: DELEGATOR_2.clone(),
amount: updelegate_amount,
amount: undelegate_amount,
},
);
assert!(updelegate_result.is_success(), "{:?}", updelegate_result);
assert!(undelegate_result.is_success(), "{:?}", undelegate_result);
builder.commit_transforms(builder.get_post_state_hash(), undelegate_result.effects());
delegator_2_stake =
get_delegator_staked_amount(&mut builder, VALIDATOR_1.clone(), DELEGATOR_2.clone());
Expand All @@ -998,9 +998,10 @@ fn should_distribute_rewards_after_restaking_delegated_funds() {
public_key: VALIDATOR_1.clone(),
amount,
delegation_rate: 0,
minimum_delegation_amount: updelegate_amount.as_u64(),
maximum_delegation_amount: updelegate_amount.as_u64(),
minimum_delegation_amount: undelegate_amount.as_u64(),
maximum_delegation_amount: undelegate_amount.as_u64(),
minimum_bid_amount: DEFAULT_MINIMUM_BID_AMOUNT,
reserved_slots: 0,
}
} else {
AuctionMethod::WithdrawBid {
Expand Down
23 changes: 9 additions & 14 deletions node/src/reactor/main_reactor/tests/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2931,8 +2931,9 @@ async fn add_and_withdraw_bid_transaction() {
PublicKey::from(&**BOB_SECRET_KEY),
0,
bid_amount,
test.chainspec().core_config.minimum_delegation_amount,
test.chainspec().core_config.maximum_delegation_amount,
None,
None,
None,
)
.unwrap()
.with_chain_name(CHAIN_NAME)
Expand Down Expand Up @@ -3090,18 +3091,12 @@ async fn insufficient_funds_add_bid() {
let bid_amount = bob_initial_balance.total;

let mut txn = Transaction::from(
TransactionV1Builder::new_add_bid(
BOB_PUBLIC_KEY.clone(),
0,
bid_amount,
test.chainspec().core_config.minimum_delegation_amount,
test.chainspec().core_config.maximum_delegation_amount,
)
.unwrap()
.with_chain_name(CHAIN_NAME)
.with_initiator_addr(PublicKey::from(&**BOB_SECRET_KEY))
.build()
.unwrap(),
TransactionV1Builder::new_add_bid(BOB_PUBLIC_KEY.clone(), 0, bid_amount, None, None, None)
.unwrap()
.with_chain_name(CHAIN_NAME)
.with_initiator_addr(PublicKey::from(&**BOB_SECRET_KEY))
.build()
.unwrap(),
);
txn.sign(&BOB_SECRET_KEY);

Expand Down

0 comments on commit 5950ef8

Please sign in to comment.