Skip to content

Commit

Permalink
implement parseValue (keep-starknet-strange#375)
Browse files Browse the repository at this point in the history
* implement parseValue

* add unit tests

* fix ParseOptResult struct def

* fix CastArgs

* fix ParseRegisterResult

* fix ParseOffsetResult

* fix OffsetValueResult

* fix RegisterOffsetResult

* better documentation and some fixes

---------

Co-authored-by: lanaivina <[email protected]>
  • Loading branch information
tcoratger and lana-shanghai authored Feb 13, 2024
1 parent 3a04e6a commit e41cfc0
Show file tree
Hide file tree
Showing 2 changed files with 720 additions and 87 deletions.
6 changes: 2 additions & 4 deletions src/math/fields/fields.zig
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,7 @@ pub fn Field(comptime F: type, comptime modulo: u256) type {
/// `true` if `self` is less than or equal to `other`, `false` otherwise.
pub fn le(self: Self, other: Self) bool {
return switch (self.cmp(other)) {
.lt => true,
.eq => true,
.lt, .eq => true,
else => false,
};
}
Expand Down Expand Up @@ -749,8 +748,7 @@ pub fn Field(comptime F: type, comptime modulo: u256) type {
/// `true` if `self` is greater than or equal to `other`, `false` otherwise.
pub fn ge(self: Self, other: Self) bool {
return switch (self.cmp(other)) {
.gt => true,
.eq => true,
.gt, .eq => true,
else => false,
};
}
Expand Down
Loading

0 comments on commit e41cfc0

Please sign in to comment.