-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
382 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import { method, assert, SmartContract } from 'scrypt-ts' | ||
import { UMath, U30, U60, U45 } from '../opmul' | ||
|
||
export class TestComparison extends SmartContract { | ||
@method() | ||
public unlockGtU30(a: U30, b: U30, c: boolean) { | ||
const c_ = UMath.gtU30(a, b) | ||
assert(c_ == c, 'result not correct') | ||
} | ||
|
||
@method() | ||
public unlockLtU30(a: U30, b: U30, c: boolean) { | ||
const c_ = UMath.ltU30(a, b) | ||
assert(c_ == c, 'result not correct') | ||
} | ||
|
||
@method() | ||
public unlockGteU30(a: U30, b: U30, c: boolean) { | ||
const c_ = UMath.gteU30(a, b) | ||
assert(c_ == c, 'result not correct') | ||
} | ||
|
||
@method() | ||
public unlockLteU30(a: U30, b: U30, c: boolean) { | ||
const c_ = UMath.lteU30(a, b) | ||
assert(c_ == c, 'result not correct') | ||
} | ||
|
||
@method() | ||
public unlockGtU45(a: U45, b: U45, c: boolean) { | ||
const c_ = UMath.gtU45(a, b) | ||
assert(c_ == c, 'result not correct') | ||
} | ||
|
||
@method() | ||
public unlockLtU45(a: U45, b: U45, c: boolean) { | ||
const c_ = UMath.ltU45(a, b) | ||
assert(c_ == c, 'result not correct') | ||
} | ||
|
||
@method() | ||
public unlockGteU45(a: U45, b: U45, c: boolean) { | ||
const c_ = UMath.gteU45(a, b) | ||
assert(c_ == c, 'result not correct') | ||
} | ||
|
||
@method() | ||
public unlockLteU45(a: U45, b: U45, c: boolean) { | ||
const c_ = UMath.lteU45(a, b) | ||
assert(c_ == c, 'result not correct') | ||
} | ||
|
||
@method() | ||
public unlockGtU60(a: U60, b: U60, c: boolean) { | ||
const c_ = UMath.gtU60(a, b) | ||
assert(c_ == c, 'result not correct') | ||
} | ||
|
||
@method() | ||
public unlockLtU60(a: U60, b: U60, c: boolean) { | ||
const c_ = UMath.ltU60(a, b) | ||
assert(c_ == c, 'result not correct') | ||
} | ||
|
||
@method() | ||
public unlockGteU60(a: U60, b: U60, c: boolean) { | ||
const c_ = UMath.gteU60(a, b) | ||
assert(c_ == c, 'result not correct') | ||
} | ||
|
||
@method() | ||
public unlockLteU60(a: U60, b: U60, c: boolean) { | ||
const c_ = UMath.lteU60(a, b) | ||
assert(c_ == c, 'result not correct') | ||
} | ||
} |
Oops, something went wrong.