Skip to content

Commit

Permalink
feat: uint validate and parsing supprot
Browse files Browse the repository at this point in the history
  • Loading branch information
tabaktoni committed Apr 12, 2023
1 parent 3d20ea4 commit c1acd29
Show file tree
Hide file tree
Showing 6 changed files with 6,633 additions and 952 deletions.
13 changes: 12 additions & 1 deletion __mocks__/cairo/helloSierra/hello.cairo
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#[contract]
mod HelloStarknet {
struct Storage {
balance: felt252,
balance: felt252,
balance_u8: u8
}

// Increases the balance by the given amount.
Expand All @@ -10,9 +11,19 @@ mod HelloStarknet {
balance::write(balance::read() + amount);
}

#[external]
fn increase_balance_u8(amount: u8) {
balance_u8::write(balance_u8::read() + amount);
}

// Returns the current balance.
#[view]
fn get_balance() -> felt252 {
balance::read()
}

#[view]
fn get_balance_u8() -> u8 {
balance_u8::read()
}
}
Loading

0 comments on commit c1acd29

Please sign in to comment.