Open ducphamle2 opened 1 month ago
The root cause of this bug remains unknown. It seems that using the Cosmos keepers at the end of NewWasmApp
directly is causing the problem. The keepers hold the store keys, and they don't match with the ctx.ms
A workaround is to add a new AnteHandler
to register the precompiled contracts with Cosmos Keepers. Because AnteHandler
can use keepers without error -> the precompiled contracts can also use them.
Fixed in #13
Context
Oraichain has a custom feature allowing EVM contracts to call CosmWasm contracts directly via Solidity.
This requires deploying a set of precompile contracts with logic written in Golang. These methods would have access to different Cosmos keepers to invoke appropriate queries and execute calls.
However, when running tests, the precompile logic couldn't have access to any module stores with the following similar errors across all modules:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
There should be no error, and a result should be returned from CosmWasm.
Additional context
NewWasmApp
methodc.ms.GetKVStore(key)
storeService.OpenKVStore(ctx)
. This is the new way of retrieving module stores of Cosmos SDK