Hello all,
I am struggling to find the right syntax to re-assign values to my record attributes.
// Here is my record.
record lockContract = {
sender : address,
receiver : address,
amount : int,
hashlock : bytes(32), // sha-2 sha256 hash
timelock : int, // UNIX timestamp seconds - locked UNTIL this time
withdrawn : bool,
refunded : bool,
preimage : bytes(32)}
// Here is my function:
public stateful entrypoint withdraw(_contractId : bytes(32), _preimage : bytes(32)) : bool =
contractExists(_contractId)
hashlockMatches(_contractId, _preimage)
withdrawable(_contractId)
let _lockContract : lockContract = state.contracts[_contractId]
_lockContract.preimage = _preimage // Error
_lockContract.withdrawn = true // Error
spend({recipient = _lockContract.receiver,
amount = _lockContract.amount})
Chain.event(LogHTLCWithdraw(_contractId))
true
I am getting error on the above marked lines.
Unexpected Token ‘=’ at … …
Question: How do I re-assign values to my temporary record variables created?