Is it possible to modify elements of Sophia lists? I guess not?
I was trying to do something like this from a stateful function:
put(state{tasks[taskID].fl = Call.origin})
tasks is defined in record state as tasks : list(task)
and task is:
record task = {
client : address,
fl : address,
taskValue : int,
workTime : int,
applyTime : int,
solutionSubmittedTime : int,
disputeStartedTime : int,
//blockHash : hash,
voteCommits : map(address, hash),
votes : map(int, int),
voters : map(int, address),
votesTotal : int,
votesClient : int,
votesFl : int,
stage : int
}
I get a compiler error:
Error: Http request for https://compiler.aepps.com/compile failed with status code 403. Status: .
Error data: {“reason”:“Type errors\nCannot unify list(task)\n and map(int, CryptoTask.task)\nwhen checking the assignment of the field\n tasks : list(task) (at line 84, column 36)\nto the old value __x and the new value\n __x {[taskID] @ __x = __x {fl = Call.origin}} :\n map(int, CryptoTask.task)\n”}
Shoud I use a mapping instead of a list for tasks (int to task)? Any other suggestions?
Thanks,
Vedran