Skip to content

Commit

Permalink
Dev review updates (foundry-rs#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
shramee authored May 8, 2023
1 parent 92a8980 commit dfef0d5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion exercises/modules/modules1.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn test_mod_fn() {
assert(order_result == 'order_taken', 'Order not taken');
}


#[cfg(test)]
mod tests {
#[test]
fn test_super_fn() {
Expand Down
4 changes: 2 additions & 2 deletions exercises/modules/modules2.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
// Run `starklings hint modules2` or `hint` watch command for a hint.

use debug::PrintTrait;
const YEAR: felt252 = 2050;
const YEAR: u16 = 2050;

mod order {
#[derive(Copy, Drop)]
struct Order {
name: felt252,
year: felt252,
year: u16,
made_by_phone: bool,
made_by_email: bool,
item: felt252,
Expand Down
2 changes: 1 addition & 1 deletion exercises/modules/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Here's some code to show modules at play,

## Declaring modules

Modules can be declared in two way,
Modules can be declared in two ways,

| Code | Description |
| --------------- | ---------------------------- |
Expand Down
3 changes: 2 additions & 1 deletion exercises/starknet/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Starknet Smart Contracts

A Starknet contract is pretty much a Cairo module, or rather, it's represented by one.
A Starknet contract can be created by annotating a Cairo module with the `#[contract]` attribute

Starknet contract don't require a `main` function.
Functions in the contract module may be annotated as a `#[view]` or an `#[external]` function. External/View functions can be called by the users of Starknet, and by other contracts. The functions without these annotations are internal and cannot be accessed by users nor by other contract.
Expand Down Expand Up @@ -85,3 +85,4 @@ fn play() {
## Further information

- For more details, check out [The Structure of a Cairo Smart Contract](https://book.starknet.io/chapter_2/structure.html) in [the Starknet book](https://book.starknet.io).
- [Cross-contract interactions](https://cairo-book.github.io/ch09-00-00-abis-and-cross-contract-interactions.html)
2 changes: 1 addition & 1 deletion info.toml
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ name = "modules2"
path = "exercises/modules/modules2.cairo"
mode = "test"
hint = """
While using functions/structs etc from outside the module,
While using functions/structs and other items from outside the module,
you can use full paths or `use` keyword to create shortcuts.
"""

Expand Down

0 comments on commit dfef0d5

Please sign in to comment.