I am creating a big_maps with a value type of struct Assets and AssetsDetails. While i try to put the value in map getting an error of: [error] File "smartML/tools/compiler.ml", line 2210, characters 18-24: Assertion failed. The error is from this part of code: assets[i]=sp.record( coin_name=coin_names[i], value=values[i], )
Here is the code:
import smartpy as sp
Asset = sp.TRecord(
coin_name=sp.TString,
value=sp.TNat
)
class Preiphery(sp.Contract):
@sp.entry_point
def send_service_message(self, _from, to, coin_names, values, fees):
sp.set_type(_from, sp.TAddress)
sp.set_type(to, sp.TString)
sp.set_type(coin_names, sp.TMap(sp.TNat, sp.TString))
sp.set_type(values, sp.TMap(sp.TNat, sp.TNat))
sp.set_type(fees, sp.TMap(sp.TNat, sp.TNat))
assets = sp.big_map(tkey=sp.TNat, tvalue=Asset)
sp.for i in sp.range(sp.nat(0), sp.len(coin_names)):
assets[i]=sp.record(
coin_name=coin_names[i],
value=values[i]
)
@sp.add_test(name="Counter")
def test():
scenario = sp.test_scenario()
counter = Preiphery()
scenario += counter