fix: historic queries on wasm smart state / staking
Summary of changes
This change fixes the issue of querying historic blocks pre-0.47 upgrade by using custom queriers for wasm and staking. It also adds a new script to test the upgrade path from v3.0.x to v3.4.3 and checks the mentioned issues pre and post fix.
Issue:
curl -s -H "X-Cosmos-block-Height: 10" "http://localhost:1317/cosmwasm/wasm/v1/contract/terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au/smart/eyJiYWxhbmNlIjp7ImFkZHJlc3MiOiJ0ZXJyYTFtNDJjcmN3OTBrNnZoZmtseWw5ZzN6ejN3cWVoMzM2eHI0bnVqdyJ9fQ=="
{"code":2,"message":"codespace undefined code 111222: panic","details":[]}
curl -s -H "X-Cosmos-block-Height: 10" http://localhost:1317/cosmos/staking/v1beta1/validators/terravaloper1vrr4wmqgxm7ms0747xsu8nwd6jfvl8kf4s93rf/delegations
{"code":13,"message":"invalid denom: ","details":[]}
Solved after patch:
curl -s -H "X-Cosmos-block-Height: 10" "http://localhost:1317/cosmwasm/wasm/v1/contract/terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au/smart/eyJiYWxhbmNlIjp7ImFkZHJlc3MiOiJ0ZXJyYTFtNDJjcmN3OTBrNnZoZmtseWw5ZzN6ejN3cWVoMzM2eHI0bnVqdyJ9fQ=="
{"data":{"balance":"1000000000"}}
curl -s -H "X-Cosmos-block-Height: 10" http://localhost:1317/cosmos/staking/v1beta1/validators/terravaloper1vrr4wmqgxm7ms0747xsu8nwd6jfvl8kf4s93rf/delegations
{"delegation_responses":[{"delegation":{"delegator_address":"terra1vrr4wmqgxm7ms0747xsu8nwd6jfvl8kf4lfvn6","validator_address":"terravaloper1vrr4wmqgxm7ms0747xsu8nwd6jfvl8kf4s93rf","shares":"1000000.000000000000000000"},"balance":{"denom":"uluna","amount":"1000000"}}],"pagination":{"next_key":null,"total":"1"}}