Skip to content

Commit

Permalink
feat: building ownership registry base test case
Browse files Browse the repository at this point in the history
  • Loading branch information
HinsonSIDAN committed Nov 28, 2023
1 parent 786adf6 commit cd88d15
Show file tree
Hide file tree
Showing 3 changed files with 353 additions and 9 deletions.
11 changes: 10 additions & 1 deletion lib/aiken-content-ownership/common.ak
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use aiken/bytearray
use aiken/list
use aiken/transaction.{Input, Output}
use aiken/transaction.{Input, Output, Spend}
use aiken/transaction/credential.{Address}
use aiken/transaction/value.{
AssetName, MintedValue, PolicyId, Value, flatten, from_minted_value,
Expand Down Expand Up @@ -161,6 +161,15 @@ pub fn value_length(value: Value) -> Int {
list.length(flatten(value))
}

pub fn compare_output_reference(x, y) {
expect Spend(out_ref_x) = x
expect Spend(out_ref_y) = y
bytearray.compare(
out_ref_x.transaction_id.hash,
out_ref_y.transaction_id.hash,
)
}

test byte_conversion() {
convert_int_to_bytes(1) == "1" && convert_int_to_bytes(123) == "123" && convert_int_to_bytes(
672912,
Expand Down
Loading

0 comments on commit cd88d15

Please sign in to comment.