-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[e2e-test] fix error EPROLOGUE_CANT_PAY_GAS_DEPOSIT
- Loading branch information
Showing
4 changed files
with
60 additions
and
5 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,45 @@ | ||
// Copyright (c) The Starcoin Core Contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use crate::transactions::TransactionBencher; | ||
use proptest::arbitrary::any_with; | ||
use starcoin_language_e2e_tests::account::AccountData; | ||
use starcoin_language_e2e_tests::account_universe::P2PTransferGen; | ||
use starcoin_language_e2e_tests::common_transactions::peer_to_peer_txn; | ||
use starcoin_language_e2e_tests::executor::FakeExecutor; | ||
|
||
#[test] | ||
pub fn bencher_sequence() { | ||
let default_num_account = 2; | ||
let default_num_transactions = 1; | ||
let maxium_transfer_balance = 100; | ||
let minium_transfer_balance = 10; | ||
|
||
let bencher = TransactionBencher::new( | ||
any_with::<P2PTransferGen>((minium_transfer_balance, maxium_transfer_balance)), | ||
default_num_account, | ||
default_num_transactions, | ||
); | ||
bencher.manual_sequence(default_num_account, default_num_transactions, 1, 1); | ||
} | ||
|
||
#[test] | ||
pub fn fake_execute_with_account_data() { | ||
// Compute gas used by running a placeholder transaction. | ||
let mut executor = FakeExecutor::from_genesis_file(); | ||
let sender = AccountData::new(1_000_000_000, 10); | ||
let receiver = AccountData::new(1_000_000_000, 10); | ||
executor.add_account_data(&sender); | ||
executor.add_account_data(&receiver); | ||
|
||
let txn = peer_to_peer_txn(sender.account(), receiver.account(), 10, 10); | ||
let result = executor.execute_block(vec![txn]); | ||
match result { | ||
Ok(outputs) => { | ||
println!("Outputs: {:#?}", outputs); | ||
} | ||
Err(err) => { | ||
println!("Error: {:#?}", err); | ||
} | ||
} | ||
} |
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