Skip to content

Commit

Permalink
SOME CLEANING UP
Browse files Browse the repository at this point in the history
  • Loading branch information
oluwa-peski committed Aug 6, 2024
1 parent 70c05bc commit 4a25d9d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
6 changes: 0 additions & 6 deletions Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,9 @@ dependencies = [
"alexandria_data_structures",
]

[[package]]
name = "cairo_lib"
version = "0.2.0"
source = "git+https://github.com/HerodotusDev/cairo-lib.git#a0c0ee4feeb4edb61e7a35d29595ad8647c3d469"

[[package]]
name = "raito"
version = "0.1.0"
dependencies = [
"alexandria_math",
"cairo_lib",
]
1 change: 0 additions & 1 deletion Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ gen_data_test= "chmod -x ./scripts/data/launch.sh && bash ./scripts/data/launch.

[dependencies]
alexandria_math = { git = "https://github.com/keep-starknet-strange/alexandria.git" }
cairo_lib = { git = "https://github.com/HerodotusDev/cairo-lib.git" }

[dev-dependencies]
cairo_test = "2.7.0"
6 changes: 5 additions & 1 deletion src/validation.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ fn convert_u32_to_u256(val: u32) -> u256 {
val_u256.low = low;
val_u256.high = high;
val_u256

}

fn compute_bitwise_not_for_u256(val: u256) -> u256 {
Expand All @@ -86,6 +85,11 @@ fn compute_bitwise_not_for_u256(val: u256) -> u256 {
not_val
}


// Need to compute 2**256 / (target+1), but we can't represent 2**256
// as it's too large for an u256. However, as 2**256 is at least as large
// as target+1, it is equal to ((2**256 - target - 1) / (target+1)) + 1,
// or ~target / (target+1) + 1.
fn compute_work_from_target(target: u256) -> u256 {
let one_i257: i257 = I257Impl::new(ONE_256, false);
let target_i257: i257 = target.into();
Expand Down

0 comments on commit 4a25d9d

Please sign in to comment.