I have the following smartpy.bigmap
in smart contract storage:
import smartpy as sp
self.data.init(bgmp=sp.bigmap(tkey=sp.TAddress,tvalue=sp.TMutez))
I would like to total all the stored tvalue
so based on the SmartPy docs I tried:
total=sp.tez(0)
sp.for v in self.data.bgmp.values():
total+=v
I then wish to sp.verify(total>=minAmount<sp.TMutez>)
When run in the latest SmartPy.io IDE the following error is produced:
Error:
Failure: Missing var v in env []
If I hardcode total+=sp.tez(1)
the error becomes:
Error:
WrongCondition in line 18: (sp.tez(0) + sp.tez(1)) >= self.data.minAmount
I am doubtful that this is a correctly totaled sp.TMutez
value.
Any help is much appreciated!