diff --git a/contracts/01-tamagotchi/tests/smoke.rs b/contracts/01-tamagotchi/tests/smoke.rs index be5b2faa..a43733c8 100644 --- a/contracts/01-tamagotchi/tests/smoke.rs +++ b/contracts/01-tamagotchi/tests/smoke.rs @@ -6,34 +6,15 @@ fn smoke_test() { let sys = System::new(); sys.init_logger(); let program = Program::current(&sys); - let result = program.send(2, String::from("Goodmoring")); + let result = program.send(2, String::from("Goodmorning")); assert!(!result.main_failed()); let result = program.send(2, TmgAction::Name); let log = Log::builder() .dest(2) - .payload(TmgEvent::Name(String::from("Goodmoring"))); + .payload(TmgEvent::Name(String::from("Goodmorning"))); assert!(result.contains(&log)); let _result = program.send(2, TmgAction::Age); - // let log = Log::builder().dest(2).payload(TmgEvent::Age(sys.block_timestamp())); + // let age = sys.spend_blocks(1); + // let log = Log::builder().dest(2).payload(TmgEvent::Age(age[0])); // assert!(result.contains(&log)); - - //How to test the age? -} - -#[test] -fn negative_smoke_test() { - let sys = System::new(); - sys.init_logger(); - let program = Program::current(&sys); - let payload = vec![1, 2, 3]; - let _result = program.send(2, payload); - // assert!(result.main_failed()); - // Why the assert is panic? - - // let result = program.send(1, TmgAction::Name); - // let log = Log::builder().dest(2).payload(TmgEvent::Name("Goodmoring".to_string())); - // assert!(!result.contains(&log)); - // let result = program.send(1, TmgAction::Age); - // let log = Log::builder().dest(2).payload(TmgEvent::Age(sys.block_timestamp())); - // assert!(!result.contains(&log)); }