SecretNetwork icon indicating copy to clipboard operation
SecretNetwork copied to clipboard

Add Iterator feature support for contracts

Open Cashmaney opened this issue 2 years ago • 1 comments

It's about time we start supporting the iterator flag - this will bring us up to par with most of the Cosmwasm v1 feature set (excluding raw queries), and support for most of the stuff in the cosmwasm-plus storage package.

To support this flag afaik we need to add support for the scan_db and db_next calls, which shouldn't be too difficult. Our keys are encrypted, so the standard behaviour can't be lifted 1:1 from Cosmwasm, but I suspect there probably won't be too much difference.

Cashmaney avatar Jul 05 '22 14:07 Cashmaney

The main issue here is that in order to decrypt the key-value pair, the contract must know what's the key beforehand. Also, the encrypted key is actually encrypted after being sha256ed.

assafmo avatar Jul 05 '22 18:07 assafmo