Open davidyuk opened 2 years ago
contractState
returned by channels.get.contract
looks this way
{
"ck_AABAf+tK": "cv_LwCs9rhl",
"ck_AAEYQB5m": "cv_P4fvHVw="
}
for contract
contract Identity =
entrypoint getArg(x : int) : int = x
I guess that ContractStoreKey (ck_
) is an entry name in bytecode and ContractStoreValue (cv_
) contains its value in binary form.
Support this should be useful for debugging, but this is out of the scope of sdk. I would redirect this issue to calldata or compiler.
Anyone interested can extend the ApiEncoder
indeed.
To decode ck
/cv
into Uint8Arrays is relatively simple, but can we get this contract state in its types or how else can it be decoded?
I've to take a look if cv_
carries some type information
https://github.com/aeternity/aepp-sdk-js/blob/9b4cee8636daf28931896ca6744c03e265fa78fb/test/integration/channel.ts#L1096
https://devchat.aeternity.com/channel/javascript-sdk?msg=n7NLQwvHnLSg7jWgq requested by @Kalovelo