bank: Add failing test for `TransactionLogCollector::get_logs_for_address()`
This commit is contained in:
parent
efedb55705
commit
dafdc15dfe
|
@ -556,7 +556,7 @@ pub struct TransactionLogCollectorConfig {
|
|||
pub filter: TransactionLogCollectorFilter,
|
||||
}
|
||||
|
||||
#[derive(AbiExample, Clone, Debug)]
|
||||
#[derive(AbiExample, Clone, Debug, PartialEq)]
|
||||
pub struct TransactionLogInfo {
|
||||
pub signature: Signature,
|
||||
pub result: Result<()>,
|
||||
|
@ -15395,4 +15395,20 @@ pub(crate) mod tests {
|
|||
let tx = Transaction::new(&[&mint_keypair], message, genesis_config.hash());
|
||||
bank.process_transaction(&tx).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn test_transaction_log_collector_get_logs_for_address() {
|
||||
let address = Pubkey::new_unique();
|
||||
let mut mentioned_address_map = HashMap::new();
|
||||
mentioned_address_map.insert(address, vec![0]);
|
||||
let transaction_log_collector = TransactionLogCollector {
|
||||
mentioned_address_map,
|
||||
..TransactionLogCollector::default()
|
||||
};
|
||||
assert_eq!(
|
||||
transaction_log_collector.get_logs_for_address(Some(&address)),
|
||||
Some(Vec::<TransactionLogInfo>::new()),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue