mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-04-28 07:17:58 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 57bb015fa3 | |||
| 4e234aa1bd | |||
| b204de5484 | |||
| 332012754d | |||
| eb6c64c17a | |||
| 76c85f191c | |||
| 7664e9735e | |||
| 4bab457114 | |||
| f6374ad52a | |||
| abba0cee08 |
@@ -25,3 +25,4 @@ sp-runtime = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
temp-dir = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
|
||||
@@ -166,6 +166,7 @@ impl KitchensinkNode {
|
||||
.clone()
|
||||
.open(self.kitchensink_stderr_log_file_path())?;
|
||||
self.process_substrate = Command::new(&self.substrate_binary)
|
||||
.arg("--dev")
|
||||
.arg("--chain")
|
||||
.arg(chainspec_path)
|
||||
.arg("--base-path")
|
||||
@@ -917,13 +918,14 @@ impl BlockHeader for KitchenSinkHeader {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use alloy::rpc::types::TransactionRequest;
|
||||
use revive_dt_config::Arguments;
|
||||
use std::path::PathBuf;
|
||||
use temp_dir::TempDir;
|
||||
|
||||
use std::fs;
|
||||
|
||||
use super::KitchensinkNode;
|
||||
use super::*;
|
||||
use crate::{GENESIS_JSON, Node};
|
||||
|
||||
fn test_config() -> (Arguments, TempDir) {
|
||||
@@ -938,6 +940,37 @@ mod tests {
|
||||
(config, temp_dir)
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn node_mines_simple_transfer_transaction_and_returns_receipt() {
|
||||
// Arrange
|
||||
let (args, _temp_dir) = test_config();
|
||||
let mut node = KitchensinkNode::new(&args);
|
||||
node.spawn(GENESIS_JSON.to_owned())
|
||||
.expect("Failed to spawn the node");
|
||||
|
||||
let provider = ProviderBuilder::new()
|
||||
.network::<KitchenSinkNetwork>()
|
||||
.wallet(args.wallet())
|
||||
.connect(&node.rpc_url)
|
||||
.await
|
||||
.expect("Failed to create provider");
|
||||
|
||||
let account_address = args.wallet().default_signer().address();
|
||||
let transaction = TransactionRequest::default()
|
||||
.to(account_address)
|
||||
.value(U256::from(100_000_000_000_000u128));
|
||||
|
||||
// Act
|
||||
let receipt = provider.send_transaction(transaction).await;
|
||||
|
||||
// Assert
|
||||
let _ = receipt
|
||||
.expect("Failed to send the transfer transaction")
|
||||
.get_receipt()
|
||||
.await
|
||||
.expect("Failed to get the receipt for the transfer");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_init_generates_chainspec_with_balances() {
|
||||
let genesis_content = r#"
|
||||
|
||||
Reference in New Issue
Block a user