Errors in daml code
- Bels3OP
- bernhard 1
fetchByKeyhas typek -> Update (ContractId t, t), meaning you feed it a key of typekand it returns a tuple consisting of a ContractId and the contract arguments.So you’d probably want
(friendCid, friendArgs) <- fetchByKey @Account t_customerin line 28, and thencreate friend with balance = friendArgs.balance + t_pointsin line 33.Note that you probably also want to archive the old accounts so add
archive selfandarchive friendCidsomewhere. - mwangii_k
I believe the code is trying to implement the sending of points from one person to another with the contract’s balance variable of both users being updated accordingly. Does anyone have an idea of how that can be implemented. Kindly.

