Skip to content

Commit a42fed5

Browse files
authored
Porting cosmos-sdk from v0.42.6 to v0.43.0 (#433)
* Porting app.go based sdk 0.43.0 * fix: sdk v0.43.0 marshaling changes * fix: test account, mint utils * fix: replace deprecated json cli codec * feat: add migration codes for ReserveAccIndex * chore: remove useless comment * chore: refactoring test_helpers * chore: fix lint appendAssign * chore: refact duplicated function * fix: WIP update docs * docs: add changelog * fix: refactor app.go
1 parent 150acef commit a42fed5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+857
-431
lines changed

CHANGELOG.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<!--
2+
Guiding Principles:
3+
4+
Changelogs are for humans, not machines.
5+
There should be an entry for every single version.
6+
The same types of changes should be grouped.
7+
Versions and sections should be linkable.
8+
The latest version comes first.
9+
The release date of each version is displayed.
10+
Mention whether you follow Semantic Versioning.
11+
12+
Usage:
13+
14+
Change log entries are to be added to the Unreleased section under the
15+
appropriate stanza (see below). Each entry should ideally include a tag and
16+
the Github issue reference in the following format:
17+
18+
* (<tag>) \#<issue-number> message
19+
20+
The issue numbers will later be link-ified during the release process so you do
21+
not have to worry about including a link manually, but you can if you wish.
22+
23+
Types of changes (Stanzas):
24+
25+
"Features" for new features.
26+
"Improvements" for changes in existing functionality.
27+
"Deprecated" for soon-to-be removed features.
28+
"Bug Fixes" for any bug fixes.
29+
"Client Breaking" for breaking Protobuf, gRPC and REST routes used by end-users.
30+
"CLI Breaking" for breaking CLI commands.
31+
"API Breaking" for breaking exported APIs used by developers building on SDK.
32+
"State Machine Breaking" for any changes that result in a different AppState given same genesisState and txList.
33+
Ref: https://keepachangelog.com/en/1.0.0/
34+
-->
35+
36+
# Changelog
37+
38+
## [Unreleased]
39+
40+
### State Machine Breaking
41+
42+
* [\#436](https://github.com/tendermint/liquidity/pull/436) Validation `MsgSwapWithinBatch` and `OfferCoinFee` ceiling
43+
* When calculating `OfferCoinFee`, the decimal points are rounded up.
44+
* Fix reserveOfferCoinFee residual Issue due to decimal error
45+
46+
* [\#433](https://github.com/tendermint/liquidity/pull/433) (sdk) Bump SDK version to [v0.43.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.43.0).
47+
48+
## [v1.2.9](https://github.com/tendermint/liquidity/releases/tag/v1.2.9) - 2021-06-26
49+
* Liquidity module version 1 for Gravity-DEX
50+
* (sdk) Bump SDK version to [v0.42.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.9).

README.md

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ For details, see the [Liquidity Module Light Paper](doc/LiquidityModuleLightPape
3535
Requirement | Notes
3636
----------- | -----------------
3737
Go version | Go1.15 or higher
38-
Cosmos SDK | v0.42.4 or higher
38+
Cosmos SDK | v0.43.0 or higher
3939

4040
### Get Liquidity Module source code
4141

@@ -133,59 +133,64 @@ Sample scripts are provided in [scripts](https://github.com/tendermint/liquidity
133133
# Build
134134
make install
135135

136+
# Set Binary name of the app
137+
# The basic simapp binary of the liquidity module is liquidityd, but set it differently depending on the situation such as gaiad.
138+
BINARY=liquidityd
139+
136140
# Initialize and add keys
137-
liquidityd init testing --chain-id testing
138-
liquidityd keys add validator --keyring-backend test
139-
liquidityd keys add user1 --keyring-backend test
141+
$BINARY init testing --chain-id testing
142+
$BINARY keys add validator --keyring-backend test
143+
$BINARY keys add user1 --keyring-backend test
140144

141145
# Add genesis accounts and provide coins to the accounts
142-
liquidityd add-genesis-account $(liquidityd keys show validator --keyring-backend test -a) 10000000000stake,10000000000uatom,500000000000uusd
143-
liquidityd add-genesis-account $(liquidityd keys show user1 --keyring-backend test -a) 10000000000stake,10000000000uatom,500000000000uusd
146+
$BINARY add-genesis-account $($BINARY keys show validator --keyring-backend test -a) 10000000000stake,10000000000uatom,500000000000uusd
147+
$BINARY add-genesis-account $($BINARY keys show user1 --keyring-backend test -a) 10000000000stake,10000000000uatom,500000000000uusd
144148

145149
# Create gentx and collect
146-
liquidityd gentx validator 1000000000stake --chain-id testing --keyring-backend test
147-
liquidityd collect-gentxs
150+
$BINARY gentx validator 1000000000stake --chain-id testing --keyring-backend test
151+
$BINARY collect-gentxs
148152

149153
# Start
150-
liquidityd start
154+
$BINARY start
151155
```
152156

153157
### 2.1 Broadcast transactions using CLI commands
154158

155159
```bash
156160
# An example of creating liquidity pool 1
157-
liquidityd tx liquidity create-pool 1 1000000000uatom,50000000000uusd --from user1 --keyring-backend test --chain-id testing -y
161+
$BINARY tx liquidity create-pool 1 1000000000uatom,50000000000uusd --from user1 --keyring-backend test --chain-id testing -b block -o json -y
158162

159163
# An example of creating liquidity pool 2
160-
liquidityd tx liquidity create-pool 1 10000000stake,10000000uusd --from validator --keyring-backend test --chain-id testing -y
164+
$BINARY tx liquidity create-pool 1 10000000stake,10000000uusd --from validator --keyring-backend test --chain-id testing -b block -o json -y
161165

162166
# An example of requesting swap
163-
liquidityd tx liquidity swap 1 1 50000000uusd uatom 0.019 0.003 --from validator --chain-id testing --keyring-backend test -y
167+
$BINARY tx liquidity swap 1 1 50000000uusd uatom 0.019 0.003 --from validator --chain-id testing --keyring-backend test -b block -o json -y
164168

165169
# An example of generating unsigned tx
166-
validator=$(liquidityd keys show validator --keyring-backend test -a)
167-
liquidityd tx liquidity swap 1 1 50000000uusd uatom 0.019 0.003 --from $validator --chain-id testing --generate-only > tx_swap.json
170+
validator=$($BINARY keys show validator --keyring-backend test -a)
171+
$BINARY tx liquidity swap 1 1 50000000uusd uatom 0.019 0.003 --from $validator --chain-id testing --generate-only > tx_swap.json
168172
cat tx_swap.json
169173

170174
# Sign the unsigned tx
171-
liquidityd tx sign tx_swap.json --from validator --chain-id testing --keyring-backend test -y > tx_swap_signed.json
175+
$BINARY tx sign tx_swap.json --from validator --chain-id testing --keyring-backend test -y > tx_swap_signed.json
172176
cat tx_swap_signed.json
173177

174178
# Encode the signed tx
175-
liquidityd tx encode tx_swap_signed.json
179+
$BINARY tx encode tx_swap_signed.json
180+
tx_bytes=$($BINARY tx encode tx_swap_signed.json)
176181
```
177182

178183
### 2.2 Broadcast transactions using REST APIs
179184

180185
For an example of broadcasting transactions using REST API (via gRPC-gateway), see Cosmos SDK [Migrating to New REST Endpoints](https://github.com/cosmos/cosmos-sdk/blob/master/docs/migrations/rest.md#migrating-to-new-rest-endpoints). Testing requires that the API server is enabled in `$HOME/.liquidityapp/config/app.toml`.
181186

182187
```bash
183-
curl --header "Content-Type: application/json" --request POST --data '{"tx_bytes":"Cp0BCpoBCigvdGVuZGVybWludC5saXF1aWRpdHkuTXNnU3dhcFdpdGhpbkJhdGNoEm4KLWNvc21vczE4cWM2ZGwwNDZ1a3V0MjN3NnF1dndmenBmeWhncDJmeHFkcXAwNhACGAEiEAoEdXVzZBIINTAwMDAwMDAqBXVhdG9tMg0KBHV1c2QSBTc1MDAwOhExOTAwMDAwMDAwMDAwMDAwMBJYClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiEDsouFptHWGniIBzFrsE26PcfH950qjnf4RaEsd+g2fA0SBAoCCH8YAxIEEMCaDBpAOI3k8fay9TziZbl+eNCqmPEF7tWXua3ad0ldNR6XOgZjKRBP9sQSxCtaRFnqc6Avep9C4Rjt+CHDahRNpZ8u3A==","mode":1}' localhost:1317/cosmos/tx/v1beta1/txs
188+
curl --header "Content-Type: application/json" --request POST --data '{"tx_bytes":"'"$tx_bytes"'","mode":1}' localhost:1317/cosmos/tx/v1beta1/txs
184189
```
185190

186191
### 2.3 Export Genesis State
187192

188-
`$ liquidityd export`
193+
`$ $BINARY export`
189194

190195
### Export empty state case
191196

0 commit comments

Comments
 (0)