Skip to content

Commit

Permalink
Updating the project due to dependency changes: . #none
Browse files Browse the repository at this point in the history
Updating the project due to dependency changes. . #none
  • Loading branch information
tonjen committed Aug 3, 2023
2 parents ed0bac6 + 2984625 commit f454759
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 56 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ failure = '0.1.0'
hex-literal = '0.3.4'
ton_block = { git = 'https://github.com/tonlabs/ever-block.git', tag = '1.9.88' }
ton_types = { git = 'https://github.com/tonlabs/ever-types.git', tag = '2.0.18' }

56 changes: 0 additions & 56 deletions src/scheme/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,59 +138,3 @@ impl Deserializable for TVC {
}
}

#[cfg(test)]
mod test {
use super::*;
use hex_literal::hex;
use ton_block::{Deserializable, Serializable};
use ton_types::{base64_encode, read_boc, write_boc};

static DESCSTR: &'static str = r#"
Once upon a time, there was a little kitten named Whiskers. Whiskers was the runt of the
litter and always had trouble keeping up with his siblings. His mother loved him dearly,
but he often felt left out during playtime.
One day, while exploring the yard, Whiskers stumbled upon a butterfly. Mesmerized by its
beauty, Whiskers chased the butterfly around the garden, forgetting all about his troubles.
From that day on, Whiskers became fascinated with the natural world and spent all his time
exploring and learning about the creatures that lived around him.
As he grew older, Whiskers became known throughout the neighborhood for his knowledge of
nature and his ability to make friends with all kinds of animals. His siblings may have
been faster and stronger, but Whiskers had found his own special talent and became a
beloved member of the community.
Despite his humble beginnings, Whiskers learned that he could achieve great things by
following his passions and staying true to himself. And he knew that no matter how
small he may seem, he had a big heart and a lot to offer the world."#;

#[test]
fn test_temp() {
let mut builder = BuilderData::new();
builder.append_u64(u64::MAX).unwrap();
builder_store_string_ref(&mut builder, DESCSTR).unwrap();

let cell = builder.into_cell().unwrap();

let mut cs = SliceData::load_cell(cell).unwrap();
let str = slice_load_string_ref(&mut cs).unwrap();

assert_eq!(DESCSTR, str, "strings are not equal");
}

#[test]
fn test_tvm_contract() {
const CODEBOC: [u8; 27] = hex!("B5EE9C7241010101000C000014FF00F8008101008011A1EF0ED546");
let code = &read_boc(&CODEBOC).unwrap().roots[0];

let tvc = TVC::new(Some(code.to_owned()), Some(DESCSTR.to_string()));

let cell = tvc.write_to_new_cell().unwrap().into_cell().unwrap();
let boc = write_boc(&cell).unwrap();

println!("{}", base64_encode(&boc));

let deserialized = TVC::construct_from_bytes(&boc).unwrap();
assert_eq!(tvc, deserialized);
}
}

0 comments on commit f454759

Please sign in to comment.