Skip to content

Commit

Permalink
feat: add mock stake script cred
Browse files Browse the repository at this point in the history
  • Loading branch information
HinsonSIDAN committed Jan 14, 2025
1 parent 3525d30 commit 597a755
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion aiken.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "sidan-lab/vodka"
version = "0.1.8"
version = "0.1.9"
compiler = "v1.1.9"
plutus = "v3"
license = "Apache-2.0"
Expand Down
19 changes: 17 additions & 2 deletions lib/mocktail/virgin_address.ak
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
use cardano/address.{
Address, Credential, Script, StakeCredential, VerificationKey,
Address, Credential, Inline, Script, StakeCredential, VerificationKey,
}
use mocktail/virgin_key_hash.{
mock_pub_key_hash, mock_script_hash, mock_script_stake_key_hash,
mock_stake_key_hash,
}
use mocktail/virgin_key_hash.{mock_pub_key_hash, mock_script_hash}

/// Mock a pub key credential
/// `variation` same the same index as `mock_pub_key_hash`
Expand Down Expand Up @@ -40,3 +43,15 @@ pub fn mock_script_address(
stake_credential,
}
}

/// Mock a pub key stake credential
/// `variation` same the same index as `mock_stake_key_hash`
pub fn mock_pub_key_stake_cred(variation: Int) -> StakeCredential {
Inline(VerificationKey(mock_stake_key_hash(variation)))
}

/// Mock a script stake credential
/// `variation` same the same index as `mock_script_stake_key_hash`
pub fn mock_script_stake_cred(variation: Int) -> StakeCredential {
Inline(Script(mock_script_stake_key_hash(variation)))
}
2 changes: 1 addition & 1 deletion plutus.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"preamble": {
"title": "sidan-lab/vodka",
"description": "Aiken utils for project 'sidan-lab/vodka",
"version": "0.1.8",
"version": "0.1.9",
"plutusVersion": "v3",
"compiler": {
"name": "Aiken",
Expand Down

0 comments on commit 597a755

Please sign in to comment.