Skip to content

Commit

Permalink
minors fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gianmarco Fraccaroli authored and Gianmarco Fraccaroli committed Apr 12, 2024
1 parent 0ca51e5 commit 3cc02d5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
4 changes: 2 additions & 2 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set -e
set -e

OUTPUT=$(cargo run --bin scenario-generator -- --steps 100)
SCENARIO_NAME="$(cut -d' ' -f2 <<<"$OUTPUT")"
echo "Using scenario $SCENARIO_NAME"
sleep 1
cargo run --bin scenario-tester -- --rpc http://127.0.0.1:27657 --chain-id local.826fff019f25befad0e2b68c --faucet-sk 00d19e226c0e7d123d79f5908b5948d4c461b66a5f8aa95600c28b55ab6f5dc772 --scenario scenarios/$SCENARIO_NAME.json
cargo run --bin scenario-tester -- --rpc 'https://proxy.heliax.click/internal-devnet-306.053460e56b' --chain-id internal-devnet-306.053460e56b --faucet-sk 00dfd790bd727b708f8b846374c596d886eaf1ebf0fc4394530e0a9b24aa630963 --scenario scenarios/$SCENARIO_NAME.json
4 changes: 2 additions & 2 deletions src/gen/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,9 @@ impl State {
tx_settings: &Option<TxSettings>,
) {
let gas_limit = if let Some(tx_settings) = tx_settings {
tx_settings.gas_limit + (1 * NATIVE_SCALE)
tx_settings.gas_limit
} else {
DEFAULT_GAS_LIMIT + (1 * NATIVE_SCALE)
DEFAULT_GAS_LIMIT
};
let gas_price = (gas_limit as f64 * DEFAULT_GAS_PRICE * NATIVE_SCALE as f64).ceil() as u64;
self.decrease_account_token_balance(address_alias, &Alias::native_token(), gas_price)
Expand Down
21 changes: 8 additions & 13 deletions src/gen/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl TaskType {
Box::new(step)
}
TaskType::TransparentTransfer => {
let source = state.random_account_with_at_least_native_token_balance(MIN_FEE);
let source = state.random_account_with_at_least_native_token_balance(MIN_FEE * 2);
let target = state.random_account(vec![source.alias.clone()]);
let token_balance = state.random_token_balance_for_alias(&source.alias);

Expand Down Expand Up @@ -566,18 +566,13 @@ impl TaskType {
TaskType::UpdateAccount => {
let source_address = state.random_virgin_address();

let tx_settings = if source_address.clone().address_type.is_implicit() {
let gas_payer = source_address.alias.clone();
TxSettings::default_from_implicit(gas_payer)
} else {
let gas_payer = state
.random_implicit_account_with_at_least_native_token_balance(MIN_FEE)
.alias;
TxSettings::default_from_enstablished(
source_address.implicit_addresses.clone(),
gas_payer,
)
};
let gas_payer = state
.random_implicit_account_with_at_least_native_token_balance(MIN_FEE)
.alias;
let tx_settings = TxSettings::default_from_enstablished(
source_address.implicit_addresses.clone(),
gas_payer,
);

let maybe_treshold = utils::random_between(1, 10);
let accounts = state.random_implicit_accounts(maybe_treshold, vec![]);
Expand Down

0 comments on commit 3cc02d5

Please sign in to comment.