This Changelog only applies to notable changes of helios.js
on the main branch.
- Addition of
Map.prepend
- Addition of comparisons for ByteArray:
<
,>
,<=
and>=
- Function definitions can ignore (all but one) argument with
_
- Functions can returns multiple values, assignments can assign multi-value rhs to multiple variables (not
const
though), and multi-value expressions are automatically flattened when used in a call
- Addition of
Map.delete
,Map.set
,Map.find
,Map.find_by_key
,Map.find_by_value
- Addition of
Map.head_key
,Map.head_value
,Map.tail
- Addition of
List.fold_lazy
,Map.fold_lazy
,Map.fold_keys_lazy
,Map.fold_values_lazy
- Printing of messages when redemption computation throws an error
- Addition of
List.sort
- Addition of
StakingHash::Validator.hash
andStakingHash::StakeKey.hash
- Addition of
Map.find_key
,Map.find_key_safe
,Map.find_value
,Map.find_value_safe
- Addition of
Map.sort
,Map.sort_by_key
,Map.sort_by_value
- Addition of
Value.get_safe
.
- Addition of
ScriptHash
,StakingHash
,StakingHash::StakeKey
,StakingHash::Validator
,StakeKeyHash
,StakingValidatorHash
(on-chain) TxOutput.ref_script_hash -> Option[ScriptHash]
getter (on-chain)(ValidatorHash|MintingPolicyHash|StakingValidatorHash).from_script_hash()
(on-chain)- Addition StakeAddress, StakeKeyHash and StakingValidatorHash (off-chain)
- Address construction distinguishes between StakeKeyHash and StakingValidatorHash
Value.to_map()
- Switch expression works over Data
- Type inference for literal enum member constructors that have zero fields
PubKey
builtin type, andPubKey.verify
method (aka verifyEd25519Signature)
- Structs with 1 field are represented directly by their contained field in Uplc
- Structs with more than 1 field are represented as a list of data in Uplc (no longer as ConstrData)
- IR functions with zero arguments become Delay terms in Uplc
- IR calls with zero arguments become Force terms in Uplc
- Core cast functions are extracted as high up as possible
- Special syntax for throwing errors inside switch/if-else branches:
error("...")
- Added
Int::from_little_endian()
- Added
Value.contains_policy()
method
- Modules functionality with
import
- Added
TxRefInput
export
- Added
new
constructor forScriptPurpose
members - Added list.
find_safe
method
redeemers
field added toTx::new
constructor
- Better error message when catching
RuntimeError
insideevalParam
- HashedDatum and InlineDatum no longer exported
- TxId and DatumHash exported,
Hash
no longer exported - changeParam handles Hash type literals
- ScriptPurpose type, with members Minting, Spending, Rewarding and Certifying
ScriptContext.get_script_purpose()
Tx.redeemers
Int::parse
- unused struct/enum fields, and unused enum variants, are now allowed
Option.unwrap()
- added
Value::from_map
- removed
tx.now()
(in favor oftx.time_range.start
andtx.time_range.end
) - changed
time_range.get_start()
totime_range.start
(is a getter!) - added
time_range.end
(is a getter!) - added
map.map_keys()
andmap.map_values()
- support for operator overloading (internally), with
Time - Duration -> Time
andDuration/Duration -> Int
as new overloads +
and*
operators are now commutative in case left and right types differ
- toSchemaJSON renamed to toSchemaJson
- tx.outputs_sent_to_datum, tx.value_sent_to_datum, tx.outputs_locked_by_datum, tx.value_locked_by_datum: now take 'isInline' as a third boolean argument
- PlutusCore renamed to UPLC everywhere
- helios.d.ts file generated
- program.changeParam accepts both jsons strings and PlutusCoreValue is value
[]a.new
method usesfunc(Int) -> a
as second arg (first arg is length), List.new_const introduced that usesa
as second arg (first arg is length).
- TxOutput can have inline datum
- TxOutput.datum returns OutputDatum enum (replaces the .datum_hash field)
- OutputDatum enum has members None, Hash and Inline
- generic Data type introduced (used by inline datum)
- All types have builtin associated ::from_data() method that converts
Data
into that type - Map.get_safe() method that returns Option
- staking script purpose
- StakingPurpose enum, with members Rewarding and Certifying, returned by ScriptContext.get_staking_purpose() (only available in staking/testing script)
- DCert enum with members Register, Deregister, Delegate, RegisterPool, RetirePool (DCertGenesis and DCertMir ignored)
- New fields for Tx: Tx.ref_inputs, Tx.dcerts and Tx.withdrawals (constructor for Tx also changed accordingly)
- ScriptContext constructors have been renamed: new_spending, new_minting, new_rewarding and new_certifying
- Library interface changed to something more object-like
- Script purpose keywords changed to 'testing', 'spending' and 'minting'
- Macro-like builtins whichs are only allowed after 'main': ValidatorHash::CURRENT, MintingPolicyHash::CURRENT, ScriptContext::new, Tx::new, TxID::CURRENT, TxInput::new, TxOutput::new
- Generally usable constructors: TxId::new, Address::new, Credential::new_pubkey, Credential::new_validator, StakingCredential::new_hash, StakingCredential::new_ptr
- First argument of AssetClass::new must be MintingPolicyHash (was ByteArray previously)
- Cost calculation of a plutus-core program run
- 'simplify' boolean flag in config object that is passed to compile()
- Map key can't be bool type (makes it easier to use bool as primitive in plutus-core, instead of as data type)
Value*Int
(not commutative) andValue/Int
operators- tx methods: 'outputs_sent_to_datum', 'outputs_locked_by_datum' and 'value_sent_to_datum' (not yet property tested)
- ByteArray.slice (negative indices relative to end)
- ByteArray starts_with and ends_with
- String starts_with and ends_with
- Map + Map operator (note: map merge doesn't assert uniqueness of keys and simply acts as a concatenation of two lists)
- Map methods: all, all_keys, all_values, any, any_key, any_value, filter, filter_by_key, filter_by_value, fold, fold_keys, fold_values
- all methods named 'get...' or 'find...' throw errors if not found
- TokenName in AssetClass is now ByteArray in order to align with Plutus-Ledger-API (used to be String)
- Rust-like syntax, structs and enums can have methods
- No commas in struct/enum-member definitions
- No semicolon after const statement
- C#-like switch syntax
- TimeRange constructors: ALWAYS, NEVER, from, to
- TimeRange comparison: is_before(Time) and is_after(Time)
- Map literal construction, Map.length, Map.is_empty() and Map.get()
- Value.get_policy()
- renamed to helios
- all named variables in the Plutus-Light are prefixed with u_ when generating the untyped IR