From 420af947540dbf2417f4f08935eb10df1b4ab9c8 Mon Sep 17 00:00:00 2001 From: Kevin Valerio Date: Wed, 23 Oct 2024 16:39:25 +0200 Subject: [PATCH] (wip) seedgen Cargo.toml edit --- toooozseed/.gitignore | 9 ---- toooozseed/Cargo.toml | 27 ------------ toooozseed/lib.rs | 97 ------------------------------------------- 3 files changed, 133 deletions(-) delete mode 100755 toooozseed/.gitignore delete mode 100755 toooozseed/Cargo.toml delete mode 100755 toooozseed/lib.rs diff --git a/toooozseed/.gitignore b/toooozseed/.gitignore deleted file mode 100755 index 8de8f87..0000000 --- a/toooozseed/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -# Ignore build artifacts from the local tests sub-crate. -/target/ - -# Ignore backup files creates by cargo fmt. -**/*.rs.bk - -# Remove Cargo.lock when creating an executable, leave it for libraries -# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock -Cargo.lock diff --git a/toooozseed/Cargo.toml b/toooozseed/Cargo.toml deleted file mode 100755 index fa8ea1d..0000000 --- a/toooozseed/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "dummy" -version = "0.1.0" -authors = ["[your_name] <[your_email]>"] -edition = "2021" - -[dependencies] -ink = { version = "5.0.0", default-features = false } -ink_prelude = { version = "5.0.0", default-features = false } - -[dev-dependencies] -ink_e2e = { version = "5.0.0" } -hex = { version = "0.4.3" } - -[lib] -path = "lib.rs" - -[features] -default = ["std"] -std = [ - "ink/std", -] - -phink = [] - -ink-as-dependency = [] -e2e-tests = [] diff --git a/toooozseed/lib.rs b/toooozseed/lib.rs deleted file mode 100755 index 3f43050..0000000 --- a/toooozseed/lib.rs +++ /dev/null @@ -1,97 +0,0 @@ -#![cfg_attr(not(feature = "std"), no_std, no_main)] -#[ink::contract] -mod dummy { - use ink::{ - prelude::vec::Vec, - storage::{ - Mapping, - StorageVec, - }, - }; - use ink_prelude::string::String; - #[ink(storage)] - #[derive(Default)] - pub struct MyBuggedContract { - forbidden_number: u32, - } - #[derive(Debug, PartialEq, Eq)] - #[ink::scale_derive(Encode, Decode, TypeInfo)] - pub enum Error {} - pub type Result = core::result::Result; - impl MyBuggedContract { - /// Creates a new domain name service contract. - #[ink(constructor)] - pub fn new() -> Self { - Default::default() - } - #[ink(message)] - pub fn crash_with_invariant(&mut self, data: String) -> Result<()> { - { - use ink_prelude::format; - let mut toz = ink::env::call::ExecutionInput::new(ink::env::call::Selector::new( - ink::selector_bytes!("crash_with_invariant"), - )) - .push_arg(&data); - let encoded = ink::scale::Encode::encode(&toz); - ink::env::debug_println!( - "ENCODED_SEED = 0x{}", - encoded - .iter() - .map(|byte| format!("{:02x}", byte)) - .collect::() - ); - } - if data.len() == 4 { - if data.chars().nth(0).unwrap() == 'f' { - if data.chars().nth(1).unwrap() == 'u' { - if data.chars().nth(2).unwrap() == 'z' { - if data.chars().nth(3).unwrap() == 'z' { - self.forbidden_number = 69; - } - } - } - } - } - Ok(()) - } - #[ink(message)] - pub fn toz(&mut self, a: u32, name: Hash) { - { - use ink_prelude::format; - let mut toz = ink::env::call::ExecutionInput::new(ink::env::call::Selector::new( - ink::selector_bytes!("toz"), - )) - .push_arg(&a) - .push_arg(&name); - let encoded = ink::scale::Encode::encode(&toz); - ink::env::debug_println!( - "ENCODED_SEED = 0x{}", - encoded - .iter() - .map(|byte| format!("{:02x}", byte)) - .collect::() - ); - } - let a = 1 + 1; - } - } - #[cfg(test)] - mod tests { - use super::*; - #[ink::test] - fn new_works() { - let mut a = MyBuggedContract::new(); - a.crash_with_invariant("xxx".to_string()).unwrap(); - } - } - #[cfg(feature = "phink")] - #[ink(impl)] - impl MyBuggedContract { - #[cfg(feature = "phink")] - #[ink(message)] - pub fn phink_assert_dangerous_number(&self) { - let forbidden_number = 42; - assert_ne!(self.forbidden_number, forbidden_number); - } - } -}