andromedaprotocol / andromeda.js

Command line interface for interactions with Andromeda contracts.
1 stars 1 forks source link

Fixed base andr queries for both v1 and v2 contracts #81

Closed arun567 closed 4 weeks ago

arun567 commented 1 year ago

Motivation

To fix both ado>>query and ado>>execute commands are not working for v2 contracts.

Implementation

There is a change in base andr queries, For v1 contracts all the base andr queries are under and_query obj key. Now andr_query is gone and they all moved to base level queries for v2.

To support both old and latest contracts, We have applied below patch code temporarily, -> First will fetch the schema version of the contract using queryContractRaw function of CosmWasm query -> Then based on the schema version, If v1 then will push the base andr queries under the and_query obj key, And if it is v2 then we will use them as base level queries without and_query obj key.

This patch is until we entirely shift to v2. After moving we will drop supporting v1

Testing

Tested both ado>>query and ado>>execute commands for both v1 and v2 contracts from CLI and they are working fine

Notes

NA

Future work

Remove the patch code that supporting v1 contracts

SlayerAnsh commented 4 weeks ago

Closing PR because its outdated and important updates were applied to andromeda.js and cli in different PR