module Refer where
import Daml.Script
import DA.Time
import DA.Date
native_test : Script ()
native_test = script do
alice ← allocateParty “Alice”
bob ← allocateParty “Bob”
let
my_int = -123
my_dec = 0.001 : Decimal
my_text = “Alice”
my_bool = False
my_date = date 2020 Jan 01
my_time = time my_date 00 00 00
my_rel_time = hours 24
assert (-my_int == 123)
assert (1000.0 * my_dec == 1.0)
assert (my_text == “Alice”)
assert (not my_bool)
assert (addDays my_date 1 == date 2020 Jan 02)
assert (addRelTime my_time my_rel_time == time (addDays my_date 1) 00 00 00)
Is below the way to trigger above script, if not plz correct my understanding.
daml script --dar .daml/dist/create-daml-app-0.1.0.dar --script-name Refer:native_test --ledger-host localhost --ledger-port 6865
Also,
what is the purpose of having constructor first and then script with do keyword.