feat: commit latest build assets for sample
This commit is contained in:
parent
ed3d143477
commit
7e6dc978a1
|
@ -1319,24 +1319,13 @@ pub fn pattern_parser() -> impl Parser<Token, ast::UntypedPattern, Error = Parse
|
||||||
label: Some(name),
|
label: Some(name),
|
||||||
value: pattern,
|
value: pattern,
|
||||||
}),
|
}),
|
||||||
r.clone().validate(|pattern, span, emit| {
|
select! {Token::Name{name} => name}.map_with_span(|name, span| ast::CallArg {
|
||||||
let label = if let ast::UntypedPattern::Var { name, .. } = &pattern {
|
|
||||||
Some(name.clone())
|
|
||||||
} else {
|
|
||||||
emit(ParseError::expected_input_found(
|
|
||||||
pattern.location(),
|
|
||||||
None,
|
|
||||||
Some(error::Pattern::RecordPunning),
|
|
||||||
));
|
|
||||||
|
|
||||||
None
|
|
||||||
};
|
|
||||||
|
|
||||||
ast::CallArg {
|
|
||||||
location: span,
|
location: span,
|
||||||
value: pattern,
|
value: ast::UntypedPattern::Var {
|
||||||
label,
|
name: name.clone(),
|
||||||
}
|
location: span,
|
||||||
|
},
|
||||||
|
label: Some(name),
|
||||||
}),
|
}),
|
||||||
))
|
))
|
||||||
.separated_by(just(Token::Comma))
|
.separated_by(just(Token::Comma))
|
||||||
|
|
|
@ -64,7 +64,7 @@ pub enum Error {
|
||||||
name: String,
|
name: String,
|
||||||
},
|
},
|
||||||
|
|
||||||
#[error("Incorrect arity\n\nExpected\n\n{expected}\n\nGiven\n\n{given}\n")]
|
#[error("Incorrect arity\n\nExpected\n\n {expected}\n\nGiven\n\n {given}\n")]
|
||||||
IncorrectArity {
|
IncorrectArity {
|
||||||
#[label]
|
#[label]
|
||||||
location: Span,
|
location: Span,
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
addr1wywnrptcz7rcmzpmmlugx5jdlsqy5kr53x5wyfrvudy63cgdwqdyp
|
addr1wxdwvaptgf8kvxj3xuud67y6mnzgkvmkmz620nc77e9u65ghx46hl
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"type": "PlutusScriptV2",
|
"type": "PlutusScriptV2",
|
||||||
"description": "Generated by Aiken",
|
"description": "Generated by Aiken",
|
||||||
"cborHex": "589358910100002225333573464646464a666ae68cdc3800a40002646464646466e212000004375a6ae84004d55d10009aba2002375a6ae84004c01000854ccd5cd19b87001480104c8c8cdc4000a40006eb4d5d080098020010a5035573a6ea800401488c8ccc00400520000032223333573466e1c0100095d0919980200219b8000348008d5d100080091aab9e37540022930b01"
|
"cborHex": "58b258b0010000222533357346464646464a666ae68cdc3800a40002646466e3c0052201030303ff00375c6ae84004c01400854ccd5cd19b87001480084c8c8cdc7800a441030303ff00375c6ae84004c0140085281aab9d375400200266446e94cdd82601010000374e66ae80008cd5d0000a61029fff004881030404ff00483403c88c8ccc00400520000032223333573466e1c0100095d0919980200219b8000348008d5d100080091aab9e37540022930b01"
|
||||||
}
|
}
|
|
@ -19,10 +19,13 @@
|
||||||
__constr_get_field
|
__constr_get_field
|
||||||
[
|
[
|
||||||
(lam
|
(lam
|
||||||
__constr_name_1
|
x
|
||||||
[
|
[
|
||||||
(lam
|
(lam
|
||||||
__subject_name_0
|
__constr_name_8
|
||||||
|
[
|
||||||
|
(lam
|
||||||
|
__subject_name_7
|
||||||
(force
|
(force
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
|
@ -31,7 +34,7 @@
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
(builtin equalsInteger)
|
(builtin equalsInteger)
|
||||||
__subject_name_0
|
__subject_name_7
|
||||||
]
|
]
|
||||||
(con integer 0)
|
(con integer 0)
|
||||||
]
|
]
|
||||||
|
@ -39,70 +42,32 @@
|
||||||
(delay
|
(delay
|
||||||
[
|
[
|
||||||
(lam
|
(lam
|
||||||
__constr_fields_5
|
__constr_fields_18
|
||||||
[
|
[
|
||||||
(lam
|
(lam
|
||||||
price
|
signer
|
||||||
[
|
|
||||||
(lam
|
|
||||||
__tail_0_3
|
|
||||||
[
|
|
||||||
(lam
|
|
||||||
__tail_1_4
|
|
||||||
[
|
|
||||||
(lam
|
|
||||||
t
|
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
(builtin
|
(builtin
|
||||||
lessThanInteger
|
equalsByteString
|
||||||
)
|
)
|
||||||
(con integer 0)
|
signer
|
||||||
]
|
]
|
||||||
price
|
(con bytestring #0303ff)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
[
|
[
|
||||||
(builtin unIData)
|
(builtin unBData)
|
||||||
[
|
|
||||||
(force
|
|
||||||
(builtin
|
|
||||||
headList
|
|
||||||
)
|
|
||||||
)
|
|
||||||
__tail_1_4
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
)
|
|
||||||
[
|
|
||||||
(force
|
|
||||||
(force
|
|
||||||
(builtin tailList)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
__tail_0_3
|
|
||||||
]
|
|
||||||
]
|
|
||||||
)
|
|
||||||
[
|
|
||||||
(force (builtin tailList))
|
|
||||||
__constr_fields_5
|
|
||||||
]
|
|
||||||
]
|
|
||||||
)
|
|
||||||
[
|
|
||||||
(builtin unIData)
|
|
||||||
[
|
[
|
||||||
(force (builtin headList))
|
(force (builtin headList))
|
||||||
__constr_fields_5
|
__constr_fields_18
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
[
|
[
|
||||||
__constr_fields_exposer
|
__constr_fields_exposer
|
||||||
__constr_name_1
|
__constr_name_8
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
@ -116,42 +81,45 @@
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
(builtin equalsInteger)
|
(builtin equalsInteger)
|
||||||
__subject_name_0
|
__subject_name_7
|
||||||
]
|
]
|
||||||
(con integer 2)
|
(con integer 1)
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
(delay
|
(delay
|
||||||
[
|
[
|
||||||
(lam
|
(lam
|
||||||
__constr_fields_2
|
__constr_fields_17
|
||||||
[
|
[
|
||||||
(lam
|
(lam
|
||||||
less
|
signer
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
(builtin
|
(builtin
|
||||||
lessThanInteger
|
equalsByteString
|
||||||
)
|
)
|
||||||
less
|
signer
|
||||||
]
|
]
|
||||||
(con integer 0)
|
(con
|
||||||
|
bytestring
|
||||||
|
#0303ff
|
||||||
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
[
|
[
|
||||||
(builtin unIData)
|
(builtin unBData)
|
||||||
[
|
[
|
||||||
(force
|
(force
|
||||||
(builtin headList)
|
(builtin headList)
|
||||||
)
|
)
|
||||||
__constr_fields_2
|
__constr_fields_17
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
[
|
[
|
||||||
__constr_fields_exposer
|
__constr_fields_exposer
|
||||||
__constr_name_1
|
__constr_name_8
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
@ -165,11 +133,41 @@
|
||||||
)
|
)
|
||||||
[
|
[
|
||||||
(force (force (builtin fstPair)))
|
(force (force (builtin fstPair)))
|
||||||
[ (builtin unConstrData) __constr_name_1 ]
|
[ (builtin unConstrData) __constr_name_8 ]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
datum
|
x
|
||||||
|
]
|
||||||
|
)
|
||||||
|
[
|
||||||
|
[
|
||||||
|
(lam
|
||||||
|
signer
|
||||||
|
(lam
|
||||||
|
amount
|
||||||
|
[
|
||||||
|
(builtin constrData)
|
||||||
|
[
|
||||||
|
[ (builtin mkPairData) (con data #00) ]
|
||||||
|
[
|
||||||
|
(builtin listData)
|
||||||
|
[
|
||||||
|
[ (force (builtin mkCons)) signer ]
|
||||||
|
[
|
||||||
|
[ (force (builtin mkCons)) amount ]
|
||||||
|
(con data #9fff)
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(con bytestring #0404ff)
|
||||||
|
]
|
||||||
|
(con integer 1000)
|
||||||
|
]
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
(lam
|
(lam
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
58910100002225333573464646464a666ae68cdc3800a40002646464646466e212000004375a6ae84004d55d10009aba2002375a6ae84004c01000854ccd5cd19b87001480104c8c8cdc4000a40006eb4d5d080098020010a5035573a6ea800401488c8ccc00400520000032223333573466e1c0100095d0919980200219b8000348008d5d100080091aab9e37540022930b01
|
58b0010000222533357346464646464a666ae68cdc3800a40002646466e3c0052201030303ff00375c6ae84004c01400854ccd5cd19b87001480084c8c8cdc7800a441030303ff00375c6ae84004c0140085281aab9d375400200266446e94cdd82601010000374e66ae80008cd5d0000a61029fff004881030404ff00483403c88c8ccc00400520000032223333573466e1c0100095d0919980200219b8000348008d5d100080091aab9e37540022930b01
|
|
@ -1 +1 @@
|
||||||
addr_test1wqwnrptcz7rcmzpmmlugx5jdlsqy5kr53x5wyfrvudy63cgkx53ty
|
addr_test1wzdwvaptgf8kvxj3xuud67y6mnzgkvmkmz620nc77e9u65gvwpxc6
|
|
@ -13,6 +13,7 @@ pub type Redeemer {
|
||||||
|
|
||||||
pub type Reen {
|
pub type Reen {
|
||||||
Buy1 { signer: ByteArray, amount: Int }
|
Buy1 { signer: ByteArray, amount: Int }
|
||||||
|
Stuff(ByteArray, Int)
|
||||||
Sell1
|
Sell1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,42 +50,10 @@ pub type Datum {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn spend(datum: Datum, _rdmr: Nil, _ctx: Nil) -> Bool {
|
pub fn spend(datum: Datum, _rdmr: Nil, _ctx: Nil) -> Bool {
|
||||||
// when datum is {
|
let x = Buy1 { signer: #[4, 4, 255], amount: 1000 }
|
||||||
// Sell -> sample.eqIntPlusOne(sample.incrementor(0, 8), 9)
|
|
||||||
// Offer {
|
|
||||||
// prices: p,
|
|
||||||
// asset_class: ac,
|
|
||||||
// other_thing: Offer {
|
|
||||||
// other_thing: Offer { asset_class: nested_signer, prices: amounts, .. },
|
|
||||||
// ..
|
|
||||||
// },
|
|
||||||
// } -> 1 == 1
|
|
||||||
// Offer { prices, other_thing: thing, .. } ->
|
|
||||||
// when prices is {
|
|
||||||
// [] -> True
|
|
||||||
// [a] -> True
|
|
||||||
// [a, b, c] -> True
|
|
||||||
// [a, b, c, d, ..e] -> sample.big_a == a
|
|
||||||
// }
|
|
||||||
// _ -> False
|
|
||||||
// }
|
|
||||||
let x = Buy1{signer: #[4, 4, 255], amount: 1000}
|
|
||||||
when x is {
|
when x is {
|
||||||
Buy1{signer, ..} -> signer == #[3,3,255]
|
Buy1 { signer, .. } -> signer == #[3, 3, 255]
|
||||||
|
Stuff(signer, _) -> signer == #[3, 3, 255]
|
||||||
_ -> False
|
_ -> False
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// let Redeemer{ signer, amount: amount2, other_thing: Redeemer{ signer: nested_signer, ..}} = datum
|
|
||||||
// True
|
|
||||||
// when datum is {
|
|
||||||
// Offer{ price: p, asset_class: ac, thing: thing, other_thing: Redeemer{ other_thing: Redeemer{ signer: nested_signer, amount: amount, ..}, .. } } -> True
|
|
||||||
// _ -> False
|
|
||||||
// }
|
|
||||||
// Offer{ prices, other_thing: thing, .. } -> {
|
|
||||||
// when prices is {
|
|
||||||
// [] -> True
|
|
||||||
// [1] -> False
|
|
||||||
// [a, b] -> True
|
|
||||||
// [a, b, ..[a]] -> False
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
Loading…
Reference in New Issue