tycho-types

Status: WIP
About
A set of primitive types and utilities for the Tycho node.
Basic usage
Decode Cell from bytes using the BOC (Bag Of Cells) format:
use Boc;
let cell: Cell = decode?;
Encode TLB model e.g.MerkleProof:
use BocRepr;
let proof = create_for_cell.build?;
let encoded = encode_base64?;
let decoded = decode_base64?:
Parse TLB type from Cell:
use BlockProof;
let proof: BlockProof = cell.?;
Parse TLB type from proof cell (partially pruned):
use DynCell;
use Block;
let virt_cell: &DynCell = proof.virtualize;
let block = virt_cell.?;
Use CellBuilder to create any Cell:
let mut builder = new;
builder.store_bit_one?;
builder.store_u32?
builder.store_slice?;
builder.store_raw?;
// store references to another cells
builder.store_reference?;
builder.store_reference?;
let final_cell: Cell = builder.build?;
// === or ===
let other_cell: Cell = build_from?;
Development
How to bench
How to miri check
# Add Miri component
# Run all tests with Miri
How to fuzz
# Install fuzzer
# Run any of the fuzzer targets
Contributing
We welcome contributions to the project! If you notice any issues or errors, feel free to open an issue or submit a pull request.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.