File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1909,6 +1909,7 @@ impl Deserialize for Strings {
19091909mod tests {
19101910 use super :: * ;
19111911 use hex:: * ;
1912+ use crate :: tx_builder_constants:: TxBuilderConstants ;
19121913
19131914 #[ test]
19141915 pub fn plutus_constr_data ( ) {
@@ -2294,4 +2295,26 @@ mod tests {
22942295 "816cdf6d4d8cba3ad0188ca643db95ddf0e03cdfc0e75a9550a72a82cb146222"
22952296 ) ;
22962297 }
2298+
2299+ #[ test]
2300+ fn test_known_plutus_data_hash_with_no_datums ( ) {
2301+ let mut costmodels = Costmdls :: new ( ) ;
2302+ costmodels. insert (
2303+ & Language :: new_plutus_v2 ( ) ,
2304+ & TxBuilderConstants :: plutus_vasil_cost_models ( ) . get ( & Language :: new_plutus_v2 ( ) ) . unwrap ( ) ,
2305+ ) ;
2306+ let hash = hash_script_data (
2307+ & Redeemers ( vec ! [
2308+ Redeemer :: new(
2309+ & RedeemerTag :: new_spend( ) ,
2310+ & BigNum :: zero( ) ,
2311+ & PlutusData :: new_empty_constr_plutus_data( & BigNum :: zero( ) ) ,
2312+ & ExUnits :: new( & to_bignum( 842996 ) , & to_bignum( 246100241 ) ) ,
2313+ ) ,
2314+ ] ) ,
2315+ & costmodels,
2316+ None ,
2317+ ) ;
2318+ assert_eq ! ( hex:: encode( hash. to_bytes( ) ) , "ac71f2adcaecd7576fa658098b12001dec03ce5c27dbb890e16966e3e135b3e2" ) ;
2319+ }
22972320}
You can’t perform that action at this time.
0 commit comments