MCPcopy Create free account
hub / github.com/ddimaria/rust-blockchain-tutorial / sends_a_transaction

Function sends_a_transaction

chain/src/transaction.rs:49–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47
48 #[tokio::test]
49 async fn sends_a_transaction() {
50 let (blockchain, _, _) = setup().await;
51 let mut transaction_storage = TransactionStorage::new();
52 let transaction = new_transaction(Account::random(), blockchain.clone()).await;
53 assert_eq!(transaction_storage.mempool.len(), 0);
54
55 transaction_storage.send_transaction(transaction);
56 assert_eq!(transaction_storage.mempool.len(), 1);
57 }
58
59 #[tokio::test]
60 async fn gets_a_transaction_receipt() {

Callers

nothing calls this directly

Calls 3

setupFunction · 0.85
new_transactionFunction · 0.70
send_transactionMethod · 0.45

Tested by

no test coverage detected