feat: commit latest build assets for sample

This commit is contained in:
rvcas 2022-12-05 14:09:52 -05:00 committed by Lucas
parent ed3d143477
commit 7e6dc978a1
8 changed files with 118 additions and 162 deletions

View File

@ -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 { location: span,
Some(name.clone()) value: ast::UntypedPattern::Var {
} else { name: name.clone(),
emit(ParseError::expected_input_found(
pattern.location(),
None,
Some(error::Pattern::RecordPunning),
));
None
};
ast::CallArg {
location: span, location: span,
value: pattern, },
label, label: Some(name),
}
}), }),
)) ))
.separated_by(just(Token::Comma)) .separated_by(just(Token::Comma))

View File

@ -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,

View File

@ -1 +1 @@
addr1wywnrptcz7rcmzpmmlugx5jdlsqy5kr53x5wyfrvudy63cgdwqdyp addr1wxdwvaptgf8kvxj3xuud67y6mnzgkvmkmz620nc77e9u65ghx46hl

View File

@ -1,5 +1,5 @@
{ {
"type": "PlutusScriptV2", "type": "PlutusScriptV2",
"description": "Generated by Aiken", "description": "Generated by Aiken",
"cborHex": "589358910100002225333573464646464a666ae68cdc3800a40002646464646466e212000004375a6ae84004d55d10009aba2002375a6ae84004c01000854ccd5cd19b87001480104c8c8cdc4000a40006eb4d5d080098020010a5035573a6ea800401488c8ccc00400520000032223333573466e1c0100095d0919980200219b8000348008d5d100080091aab9e37540022930b01" "cborHex": "58b258b0010000222533357346464646464a666ae68cdc3800a40002646466e3c0052201030303ff00375c6ae84004c01400854ccd5cd19b87001480084c8c8cdc7800a441030303ff00375c6ae84004c0140085281aab9d375400200266446e94cdd82601010000374e66ae80008cd5d0000a61029fff004881030404ff00483403c88c8ccc00400520000032223333573466e1c0100095d0919980200219b8000348008d5d100080091aab9e37540022930b01"
} }

View File

@ -19,157 +19,155 @@
__constr_get_field __constr_get_field
[ [
(lam (lam
__constr_name_1 x
[ [
(lam (lam
__subject_name_0 __constr_name_8
(force [
[ (lam
[ __subject_name_7
(force
[ [
(force (builtin ifThenElse))
[ [
[ [
(builtin equalsInteger) (force (builtin ifThenElse))
__subject_name_0 [
[
(builtin equalsInteger)
__subject_name_7
]
(con integer 0)
]
] ]
(con integer 0) (delay
]
]
(delay
[
(lam
__constr_fields_5
[ [
(lam (lam
price __constr_fields_18
[ [
(lam (lam
__tail_0_3 signer
[ [
(lam
__tail_1_4
[
(lam
t
[
[
(builtin
lessThanInteger
)
(con integer 0)
]
price
]
)
[
(builtin unIData)
[
(force
(builtin
headList
)
)
__tail_1_4
]
]
]
)
[ [
(force (builtin
(force equalsByteString
(builtin tailList)
)
) )
__tail_0_3 signer
] ]
(con bytestring #0303ff)
] ]
) )
[ [
(force (builtin tailList)) (builtin unBData)
__constr_fields_5 [
(force (builtin headList))
__constr_fields_18
]
] ]
] ]
) )
[ [
(builtin unIData) __constr_fields_exposer
[ __constr_name_8
(force (builtin headList))
__constr_fields_5
]
] ]
] ]
) )
[
__constr_fields_exposer
__constr_name_1
]
] ]
) (delay
] (force
(delay
(force
[
[
[ [
(force (builtin ifThenElse))
[ [
[ [
(builtin equalsInteger) (force (builtin ifThenElse))
__subject_name_0 [
[
(builtin equalsInteger)
__subject_name_7
]
(con integer 1)
]
] ]
(con integer 2) (delay
]
]
(delay
[
(lam
__constr_fields_2
[ [
(lam (lam
less __constr_fields_17
[ [
(lam
signer
[
[
(builtin
equalsByteString
)
signer
]
(con
bytestring
#0303ff
)
]
)
[ [
(builtin (builtin unBData)
lessThanInteger [
) (force
less (builtin headList)
)
__constr_fields_17
]
] ]
(con integer 0)
] ]
) )
[ [
(builtin unIData) __constr_fields_exposer
[ __constr_name_8
(force
(builtin headList)
)
__constr_fields_2
]
] ]
] ]
) )
[
__constr_fields_exposer
__constr_name_1
]
] ]
) (delay (con bool False))
] ]
(delay (con bool False)) )
] )
) ]
) )
)
[
(force (force (builtin fstPair)))
[ (builtin unConstrData) __constr_name_8 ]
]
]
)
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)
(force (force (builtin fstPair)))
[ (builtin unConstrData) __constr_name_1 ]
]
] ]
) (con integer 1000)
datum ]
] ]
) )
(lam (lam

View File

@ -1 +1 @@
58910100002225333573464646464a666ae68cdc3800a40002646464646466e212000004375a6ae84004d55d10009aba2002375a6ae84004c01000854ccd5cd19b87001480104c8c8cdc4000a40006eb4d5d080098020010a5035573a6ea800401488c8ccc00400520000032223333573466e1c0100095d0919980200219b8000348008d5d100080091aab9e37540022930b01 58b0010000222533357346464646464a666ae68cdc3800a40002646466e3c0052201030303ff00375c6ae84004c01400854ccd5cd19b87001480084c8c8cdc7800a441030303ff00375c6ae84004c0140085281aab9d375400200266446e94cdd82601010000374e66ae80008cd5d0000a61029fff004881030404ff00483403c88c8ccc00400520000032223333573466e1c0100095d0919980200219b8000348008d5d100080091aab9e37540022930b01

View File

@ -1 +1 @@
addr_test1wqwnrptcz7rcmzpmmlugx5jdlsqy5kr53x5wyfrvudy63cgkx53ty addr_test1wzdwvaptgf8kvxj3xuud67y6mnzgkvmkmz620nc77e9u65gvwpxc6

View File

@ -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
// }
// }