Skip to content

Commit 838a94e

Browse files
authored
Add more address balance transfer helpers to test tx builder (#24309)
## Description Make the sends funds API in test transaction builder more comprehensive: it would now support different funding source, including both coin objects and address balances. Then it can send to address balance. Port existing tests to use it. ## Test plan CI --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] gRPC: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] Indexing Framework:
1 parent 683c83b commit 838a94e

File tree

4 files changed

+266
-171
lines changed

4 files changed

+266
-171
lines changed

crates/sui-core/src/unit_tests/coin_deny_list_tests.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use move_core_types::identifier::Identifier;
1010
use move_core_types::language_storage::{StructTag, TypeTag};
1111
use std::sync::Arc;
1212
use sui_protocol_config::{Chain, PerObjectCongestionControlMode, ProtocolConfig, ProtocolVersion};
13-
use sui_test_transaction_builder::TestTransactionBuilder;
13+
use sui_test_transaction_builder::{FundSource, TestTransactionBuilder};
1414
use sui_types::base_types::{ObjectID, ObjectRef, SuiAddress, dbg_addr};
1515
use sui_types::crypto::{AccountKeyPair, get_account_key_pair};
1616
use sui_types::deny_list_v1::{CoinDenyCap, RegulatedCoinMetadata};
@@ -238,7 +238,11 @@ async fn test_regulated_coin_v2_funds_withdraw_deny() {
238238
env_gas_ref,
239239
env.authority.reference_gas_price_for_testing().unwrap(),
240240
)
241-
.transfer_funds_to_address_balance(100_000_000, regulated_coin_type.clone(), denied_address)
241+
.transfer_funds_to_address_balance(
242+
FundSource::address_fund(),
243+
vec![(100_000_000, denied_address)],
244+
regulated_coin_type.clone(),
245+
)
242246
.build_and_sign(&env.keypair);
243247
let effects = send_and_confirm_transaction_(&env.authority, None, tx, true)
244248
.await

0 commit comments

Comments
 (0)