feat: bring over the formatter from gleam
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
pub type ScriptContext {
|
||||
thing: String
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
pub type ScriptContext { thing: String }
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
pub type ScriptContext(purpose) {
|
||||
tx_info: TxInfo,
|
||||
script_purpose: purpose
|
||||
}
|
||||
|
||||
pub type TxInfo {
|
||||
idk: Int
|
||||
}
|
||||
|
||||
|
||||
|
||||
pub type ScriptContext(purpose) { tx_info: TxInfo, script_purpose: purpose }
|
||||
|
||||
pub type TxInfo { idk: Int }
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
use sample/context
|
||||
|
||||
pub type Mint {
|
||||
currency_symbol: ByteArray
|
||||
}
|
||||
|
||||
pub type ScriptContext = context.ScriptContext(Mint)
|
||||
|
||||
|
||||
|
||||
pub type Mint { currency_symbol: ByteArray }
|
||||
|
||||
pub type ScriptContext =
|
||||
context.ScriptContext(Mint)
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
use sample/context
|
||||
|
||||
pub type Spend {
|
||||
idk: Int
|
||||
}
|
||||
|
||||
pub type ScriptContext = context.ScriptContext(Spend)
|
||||
|
||||
|
||||
|
||||
pub type Spend { idk: Int }
|
||||
|
||||
pub type ScriptContext =
|
||||
context.ScriptContext(Spend)
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
use sample/mint
|
||||
use sample/spend
|
||||
|
||||
pub type Datum {
|
||||
something: String,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
pub type Datum { something: String }
|
||||
|
||||
pub type Redeemer {
|
||||
Buy
|
||||
@@ -11,8 +13,8 @@ pub type Redeemer {
|
||||
}
|
||||
|
||||
pub fn spend(datum: Datum, rdmr: Redeemer, ctx: spend.ScriptContext) -> Bool {
|
||||
when rdmr is {
|
||||
when rdmr is {
|
||||
Buy -> True
|
||||
Sell -> datum.something == "Aiken"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user