Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: scarb #7

Merged
merged 3 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/scarb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Scarb

on:
push:
branches:
- main
paths-ignore:
- "**.md"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- "**.md"

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: software-mansion/setup-scarb@v1
- run: scarb fmt --check
- run: scarb test
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# xoroshiro-cairo

![tests](https://github.com/milancermak/xoroshiro-cairo/actions/workflows/scarb.yml/badge.svg)

A [xoroshiro128**](https://prng.di.unimi.it/) pseudorandom number generator implementation in Cairo.

## Usage
Expand Down
6 changes: 4 additions & 2 deletions src/xoroshiro.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ trait IXoroshiro<TContractStorage> {
fn next(ref self: TContractStorage) -> u128;
}

#[starknet::contract]
#[starknet::contract]
mod Xoroshiro {
const U64: u128 = 0xffffffffffffffff_u128; // 2**64-1

Expand Down Expand Up @@ -76,7 +76,9 @@ mod Xoroshiro {
mod test {
use array::{ArrayTrait, SpanTrait};
use option::OptionTrait;
use starknet::{class_hash_try_from_felt252, ContractAddress, deploy_syscall, SyscallResultTrait};
use starknet::{
class_hash_try_from_felt252, ContractAddress, deploy_syscall, SyscallResultTrait
};
use traits::Default;

use super::{IXoroshiroDispatcher, IXoroshiroDispatcherTrait, Xoroshiro};
Expand Down