Skip to content

Commit

Permalink
updates script and fix test pass ci
Browse files Browse the repository at this point in the history
  • Loading branch information
DongLieu committed Nov 4, 2024
1 parent 32d9fdb commit eba4c8f
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 25 deletions.
14 changes: 0 additions & 14 deletions script/proposal-2.json

This file was deleted.

41 changes: 41 additions & 0 deletions script/proposal-psm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"messages": [{
"@type": "/reserve.psm.v1.MsgAddStableCoin",
"authority":"onomy10d07y265gmmuvt4z0w9aw880jnsr700jqr8n8k",
"denom": "usdt",
"limit_total": "100000000000000000000000000000",
"fee_in": "0.001000000000000000",
"fee_out": "0.001000000000000000",
"nom_type":"nomUSD"
},
{
"@type": "/reserve.psm.v1.MsgAddStableCoin",
"authority":"onomy10d07y265gmmuvt4z0w9aw880jnsr700jqr8n8k",
"denom": "usdc",
"limit_total": "100000000000000000000000000000",
"fee_in": "0.001000000000000000",
"fee_out": "0.001000000000000000",
"nom_type":"nomUSD"
},
{
"@type": "/reserve.psm.v1.MsgAddStableCoin",
"authority":"onomy10d07y265gmmuvt4z0w9aw880jnsr700jqr8n8k",
"denom": "jpyt",
"limit_total": "100000000000000000000000000000",
"fee_in": "0.001000000000000000",
"fee_out": "0.001000000000000000",
"nom_type":"nomJPY"
},
{
"@type": "/reserve.psm.v1.MsgAddStableCoin",
"authority":"onomy10d07y265gmmuvt4z0w9aw880jnsr700jqr8n8k",
"denom": "eurt",
"limit_total": "100000000000000000000000000000",
"fee_in": "0.001000000000000000",
"fee_out": "0.001000000000000000",
"nom_type":"nomEUR"
}],
"deposit": "100000000stake",
"title": "My proposal",
"summary": "A short summary of my proposal"
}
30 changes: 19 additions & 11 deletions script/psm-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ echo $mnemonic2| reserved keys add validator2 --recover --keyring-backend=test -
echo $mnemonic3| reserved keys add validator3 --recover --keyring-backend=test --home=$HOME/.reserved/validator3

# create validator node with tokens to transfer to the three other nodes
reserved genesis add-genesis-account $(reserved keys show validator1 -a --keyring-backend=test --home=$HOME/.reserved/validator1) 10000000000000000000000000000000stake,10000000000000000000000000000000usdt --home=$HOME/.reserved/validator1
reserved genesis add-genesis-account $(reserved keys show validator2 -a --keyring-backend=test --home=$HOME/.reserved/validator2) 10000000000000000000000000000000stake,10000000000000000000000000000000usdt --home=$HOME/.reserved/validator1
reserved genesis add-genesis-account $(reserved keys show validator3 -a --keyring-backend=test --home=$HOME/.reserved/validator3) 10000000000000000000000000000000stake,10000000000000000000000000000000usdt --home=$HOME/.reserved/validator1
reserved genesis add-genesis-account $(reserved keys show validator1 -a --keyring-backend=test --home=$HOME/.reserved/validator1) 10000000000000000000000000000000stake,10000000000000000000000000000000usdt --home=$HOME/.reserved/validator2
reserved genesis add-genesis-account $(reserved keys show validator2 -a --keyring-backend=test --home=$HOME/.reserved/validator2) 10000000000000000000000000000000stake,10000000000000000000000000000000usdt --home=$HOME/.reserved/validator2
reserved genesis add-genesis-account $(reserved keys show validator3 -a --keyring-backend=test --home=$HOME/.reserved/validator3) 10000000000000000000000000000000stake,10000000000000000000000000000000usdt --home=$HOME/.reserved/validator2
reserved genesis add-genesis-account $(reserved keys show validator1 -a --keyring-backend=test --home=$HOME/.reserved/validator1) 10000000000000000000000000000000stake,10000000000000000000000000000000usdt --home=$HOME/.reserved/validator3
reserved genesis add-genesis-account $(reserved keys show validator2 -a --keyring-backend=test --home=$HOME/.reserved/validator2) 10000000000000000000000000000000stake,10000000000000000000000000000000usdt --home=$HOME/.reserved/validator3
reserved genesis add-genesis-account $(reserved keys show validator3 -a --keyring-backend=test --home=$HOME/.reserved/validator3) 10000000000000000000000000000000stake,10000000000000000000000000000000usdt --home=$HOME/.reserved/validator3
reserved genesis add-genesis-account $(reserved keys show validator1 -a --keyring-backend=test --home=$HOME/.reserved/validator1) 10000000000000000000000000000000stake,10000000000000000000000000000000usdt,10000000000000000000000000000000eurt,10000000000000000000000000000000usdc,10000000000000000000000000000000jpyt --home=$HOME/.reserved/validator1
reserved genesis add-genesis-account $(reserved keys show validator2 -a --keyring-backend=test --home=$HOME/.reserved/validator2) 10000000000000000000000000000000stake,10000000000000000000000000000000usdt,10000000000000000000000000000000eurt,10000000000000000000000000000000usdc,10000000000000000000000000000000jpyt --home=$HOME/.reserved/validator1
reserved genesis add-genesis-account $(reserved keys show validator3 -a --keyring-backend=test --home=$HOME/.reserved/validator3) 10000000000000000000000000000000stake,10000000000000000000000000000000usdt,10000000000000000000000000000000eurt,10000000000000000000000000000000usdc,10000000000000000000000000000000jpyt --home=$HOME/.reserved/validator1
reserved genesis add-genesis-account $(reserved keys show validator1 -a --keyring-backend=test --home=$HOME/.reserved/validator1) 10000000000000000000000000000000stake,10000000000000000000000000000000usdt,10000000000000000000000000000000eurt,10000000000000000000000000000000usdc,10000000000000000000000000000000jpyt --home=$HOME/.reserved/validator2
reserved genesis add-genesis-account $(reserved keys show validator2 -a --keyring-backend=test --home=$HOME/.reserved/validator2) 10000000000000000000000000000000stake,10000000000000000000000000000000usdt,10000000000000000000000000000000eurt,10000000000000000000000000000000usdc,10000000000000000000000000000000jpyt --home=$HOME/.reserved/validator2
reserved genesis add-genesis-account $(reserved keys show validator3 -a --keyring-backend=test --home=$HOME/.reserved/validator3) 10000000000000000000000000000000stake,10000000000000000000000000000000usdt,10000000000000000000000000000000eurt,10000000000000000000000000000000usdc,10000000000000000000000000000000jpyt --home=$HOME/.reserved/validator2
reserved genesis add-genesis-account $(reserved keys show validator1 -a --keyring-backend=test --home=$HOME/.reserved/validator1) 10000000000000000000000000000000stake,10000000000000000000000000000000usdt,10000000000000000000000000000000eurt,10000000000000000000000000000000usdc,10000000000000000000000000000000jpyt --home=$HOME/.reserved/validator3
reserved genesis add-genesis-account $(reserved keys show validator2 -a --keyring-backend=test --home=$HOME/.reserved/validator2) 10000000000000000000000000000000stake,10000000000000000000000000000000usdt,10000000000000000000000000000000eurt,10000000000000000000000000000000usdc,10000000000000000000000000000000jpyt --home=$HOME/.reserved/validator3
reserved genesis add-genesis-account $(reserved keys show validator3 -a --keyring-backend=test --home=$HOME/.reserved/validator3) 10000000000000000000000000000000stake,10000000000000000000000000000000usdt,10000000000000000000000000000000eurt,10000000000000000000000000000000usdc,10000000000000000000000000000000jpyt --home=$HOME/.reserved/validator3
reserved genesis gentx validator1 1000000000000000000000stake --keyring-backend=test --home=$HOME/.reserved/validator1 --chain-id=testing-1
reserved genesis gentx validator2 1000000000000000000000stake --keyring-backend=test --home=$HOME/.reserved/validator2 --chain-id=testing-1
reserved genesis gentx validator3 1000000000000000000000stake --keyring-backend=test --home=$HOME/.reserved/validator3 --chain-id=testing-1
Expand Down Expand Up @@ -118,7 +118,7 @@ screen -S onomy3 -t onomy3 -d -m reserved start --home=$HOME/.reserved/validator

# submit proposal add usdt
sleep 7
reserved tx gov submit-proposal ./script/proposal-2.json --home=$HOME/.reserved/validator1 --from validator1 --keyring-backend test --fees 20stake --chain-id testing-1 -y
reserved tx gov submit-proposal ./script/proposal-psm.json --home=$HOME/.reserved/validator1 --from validator1 --keyring-backend test --fees 20stake --chain-id testing-1 -y

# # # vote
sleep 7
Expand All @@ -138,10 +138,18 @@ reserved q bank balances $(reserved keys show validator1 -a --keyring-backend te
# echo "========swap==========="
reserved tx psm swap-to-nomUSD 100000000000000000000000usdt --from validator1 --keyring-backend test --home ~/.reserved/validator1 --chain-id testing-1 -y --fees 20stake

sleep 7

reserved tx psm swap-to-nomUSD 100000000000000000000000eurt --from validator1 --keyring-backend test --home ~/.reserved/validator1 --chain-id testing-1 -y --fees 20stake

sleep 7

reserved tx psm swap-to-nomUSD 100000000000000000000000usdc --from validator1 --keyring-backend test --home ~/.reserved/validator1 --chain-id testing-1 -y --fees 20stake
sleep 7
reserved tx psm swap-to-nomUSD 100000000000000000000000jpyt --from validator1 --keyring-backend test --home ~/.reserved/validator1 --chain-id testing-1 -y --fees 20stake
sleep 7
# # Check account after swap
reserved q bank balances $(reserved keys show validator1 -a --keyring-backend test --home /Users/donglieu/.reserved/validator1)

# # tx swap nomUSD to usdt
# reserved tx psm swap-to-stablecoin usdt 1000nomUSD --from validator1 --keyring-backend test --home ~/.reserved/validator1 --chain-id testing-1 -y --fees 20stake

Expand Down
1 change: 1 addition & 0 deletions x/psm/keeper/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func (s *KeeperTestSuite) TestUpdatesStablecoinEpoch() {
LimitTotal: limitUSDT,
FeeIn: t.feeIn,
FeeOut: t.feeOut,
NomType: "nomUSD",
})
s.mockOracleKeeper.SetPrice(s.Ctx, sc.Denom, t.priceCurrent)
err := s.k.Stablecoins.Set(s.Ctx, sc.Denom, sc)
Expand Down

0 comments on commit eba4c8f

Please sign in to comment.