chore: convert gift card tutorial to v3
This commit is contained in:
parent
3521a8c921
commit
c87f459ce7
|
@ -17,8 +17,8 @@ type Action {
|
|||
type SpendTokenName =
|
||||
ByteArray
|
||||
|
||||
validator(creator: ByteArray) {
|
||||
fn redeem(
|
||||
validator redeem(creator: ByteArray) {
|
||||
spend(
|
||||
// Each spend input checks for a token name matching the datum being burned
|
||||
datum: SpendTokenName,
|
||||
_r: Data,
|
||||
|
@ -47,7 +47,7 @@ validator(creator: ByteArray) {
|
|||
) == -1
|
||||
}
|
||||
|
||||
fn gift_card(rdmr: Action, ctx: ScriptContext) -> Bool {
|
||||
mint(rdmr: Action, ctx: ScriptContext) -> Bool {
|
||||
// get values from transaction and purpose
|
||||
let ScriptContext { transaction, purpose } = ctx
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@ type Action {
|
|||
Burn
|
||||
}
|
||||
|
||||
validator(token_name: ByteArray, utxo_ref: OutputReference) {
|
||||
fn gift_card(rdmr: Action, ctx: ScriptContext) -> Bool {
|
||||
validator gift_card(token_name: ByteArray, utxo_ref: OutputReference) {
|
||||
mint(rdmr: Action, ctx: ScriptContext) -> Bool {
|
||||
let ScriptContext { transaction, purpose } = ctx
|
||||
|
||||
expect tx.Mint(policy_id) = purpose
|
||||
|
@ -33,8 +33,8 @@ validator(token_name: ByteArray, utxo_ref: OutputReference) {
|
|||
}
|
||||
}
|
||||
|
||||
validator(token_name: ByteArray, policy_id: ByteArray) {
|
||||
fn redeem(_d: Data, _r: Data, ctx: ScriptContext) -> Bool {
|
||||
validator redeem(token_name: ByteArray, policy_id: ByteArray) {
|
||||
spend(_d: Data, _r: Data, ctx: ScriptContext) -> Bool {
|
||||
let ScriptContext { transaction, .. } = ctx
|
||||
|
||||
let Transaction { mint, .. } = transaction
|
||||
|
|
Loading…
Reference in New Issue