Generate Address
Define an asynchronous test function using the #[tokio::test]
attribute. This sets up our test environment and allows us to use async/await
syntax within our test.
#![allow(unused)] fn main() { #[tokio::test] async fn test() { } }
Then add a section to read the "counter" contract from its bytecode which was generated earlier and
can be found under the out/debug
directory.
#![allow(unused)] fn main() { #[tokio::test] async fn test() { let path: std::path::PathBuf = concat!( env!("CARGO_MANIFEST_DIR"), "/../contract/out/debug/counter.json" ) .into(); let counter = serde_json::from_reader(std::io::BufReader::new(std::fs::File::open(path).unwrap())) .unwrap(); } }