mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-10-17 15:21:39 +02:00
test contract accounts
This commit is contained in:
@@ -145,13 +145,28 @@ fn contract_accounts_impl(test_dir: &'static str) -> Result<(), libwallet::Error
|
|||||||
// check tx log as well
|
// check tx log as well
|
||||||
let (_, txs) = api.retrieve_txs(m, true, None, None, None)?;
|
let (_, txs) = api.retrieve_txs(m, true, None, None, None)?;
|
||||||
assert_eq!(txs.len(), 0);
|
assert_eq!(txs.len(), 0);
|
||||||
|
|
||||||
|
// Do not fall back to another account when the active account has no funds
|
||||||
|
let progress = common::wallet_progress(api, m)?;
|
||||||
|
let err = api
|
||||||
|
.contract_new(
|
||||||
|
m,
|
||||||
|
&ContractNewArgsAPI {
|
||||||
|
setup_args: ContractSetupArgsAPI {
|
||||||
|
net_change: Some(-(reward as i64)),
|
||||||
|
selection_args: common::contract_selection_args(),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.unwrap_err();
|
||||||
|
assert!(matches!(err, libwallet::Error::NotEnoughFunds { .. }));
|
||||||
|
assert_eq!(common::wallet_progress(api, m)?, progress);
|
||||||
Ok(())
|
Ok(())
|
||||||
},
|
},
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
// TODO: check what send_tx_slate_direct call does in accounts.rs test
|
|
||||||
// TODO: check that you can't call send on the default account because you have no funds
|
|
||||||
|
|
||||||
// Send a tx from wallet1::account1 -> wallet2::listener_account
|
// Send a tx from wallet1::account1 -> wallet2::listener_account
|
||||||
{
|
{
|
||||||
wallet_inst!(wallet1, w);
|
wallet_inst!(wallet1, w);
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ without a user confirmation step.
|
|||||||
- Infer `--receive` and `--send` from the slate state.
|
- Infer `--receive` and `--send` from the slate state.
|
||||||
- Revisit `remove_other_sigdata` before allowing more than two participants.
|
- Revisit `remove_other_sigdata` before allowing more than two participants.
|
||||||
- Stop relying on TxLog offsets in contract tests.
|
- Stop relying on TxLog offsets in contract tests.
|
||||||
- Finish the account-switching tests in `contract_accounts.rs`.
|
|
||||||
|
|
||||||
### Side-effects
|
### Side-effects
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user