Skip to content

Commit

Permalink
chore: update gift card example to use new validator syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
rvcas committed Mar 27, 2023
1 parent bb820eb commit 0060d29
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/gift_card/validators/main.ak
Expand Up @@ -8,8 +8,8 @@ type Action {
Burn
}

validator gift_card(token_name: ByteArray, utxo_ref: OutputReference) {
fn(rdmr: Action, ctx: ScriptContext) -> Bool {
validator(token_name: ByteArray, utxo_ref: OutputReference) {
fn gift_card(rdmr: Action, ctx: ScriptContext) -> Bool {
let ScriptContext { transaction, purpose } = ctx

expect tx.Mint(policy_id) = purpose
Expand All @@ -32,8 +32,8 @@ validator gift_card(token_name: ByteArray, utxo_ref: OutputReference) {
}
}

validator redeem(token_name: ByteArray, policy_id: ByteArray) {
fn(_d: Data, _r: Data, ctx: ScriptContext) -> Bool {
validator(token_name: ByteArray, policy_id: ByteArray) {
fn redeem(_d: Data, _r: Data, ctx: ScriptContext) -> Bool {
let ScriptContext { transaction, .. } = ctx

let Transaction { mint, .. } = transaction
Expand Down

0 comments on commit 0060d29

Please sign in to comment.