Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
sourabhniyogi committed Sep 25, 2024
1 parent 5be54ad commit 87e0187
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions guest-programs/jam-service-fib/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ extern "C" {
pub fn sha2_256(data: *const u8, data_len: u32, hash_ptr: *mut u8) -> u32;
}

fn is_authorized() -> bool {
pub fn is_authorized() -> bool {
true
}

fn refine() -> [u8; 12] {
pub fn refine() -> [u8; 12] {
let mut buffer = [0u8; 12];
let result = unsafe { import(0, buffer.as_mut_ptr(), buffer.len() as u32) };

Expand Down Expand Up @@ -106,8 +106,8 @@ fn refine() -> [u8; 12] {
buffer
}

fn accumulate() -> [u8; 12] {
let mut buffer = [0u8; 12];
pub fn accumulate() -> [u8; 12] {
let buffer = [0u8; 12];
let key = [0u8; 1];

unsafe {
Expand All @@ -117,10 +117,15 @@ fn accumulate() -> [u8; 12] {
buffer
}

fn on_transfer() -> bool {
pub fn on_transfer() -> bool {
true
}

pub fn main() {
refine();
accumulate();
}

/*
(1) cargo build works but you have to get toolchain
https://github.com/paritytech/rustc-rv32e-toolchain/
Expand Down

0 comments on commit 87e0187

Please sign in to comment.