Skip to content

Commit

Permalink
added lava token instead of stake, moved scripts to scripts folder, c…
Browse files Browse the repository at this point in the history
…hanged minStake params to sdk.Coin type
  • Loading branch information
omerlavanet committed Jun 16, 2022
1 parent b20be23 commit fb0455c
Show file tree
Hide file tree
Showing 38 changed files with 245 additions and 207 deletions.
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ import (
)

const (
AccountAddressPrefix = "cosmos"
AccountAddressPrefix = "lava@"
Name = "lava"
)

Expand Down
36 changes: 23 additions & 13 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,49 @@ build:
main: "cmd/lavad"
accounts:
- name: alice
coins: ["20000token", "200000000000stake"]
coins: ["200000000000ulava"]
- name: bob
coins: ["10000token", "100000000stake"]
coins: ["100000000ulava"]
- name: user1
coins: ["10000token", "200000000stake"]
coins: ["200000000ulava"]
- name: user2
coins: ["10000token", "200000000stake"]
coins: ["200000000ulava"]
- name: user3
coins: ["10000token", "200000000stake"]
coins: ["200000000ulava"]
- name: servicer1
coins: ["10000token", "200000000stake"]
coins: ["200000000ulava"]
- name: servicer2
coins: ["10000token", "200000000stake"]
coins: ["200000000ulava"]
- name: servicer3
coins: ["10000token", "200000000stake"]
coins: ["200000000ulava"]
- name: servicer4
coins: ["10000token", "200000000stake"]
coins: ["200000000ulava"]
- name: servicer5
coins: ["10000token", "200000000stake"]
coins: ["200000000ulava"]
validator:
name: alice
staked: "100000000000stake"
staked: "100000000000ulava"
client:
openapi:
path: "docs/static/openapi.yml"
vuex:
path: "vue/src/store"
faucet:
name: bob
coins: ["5token", "100000stake"]
coins: ["100000ulava"]
genesis:
chain_id: "lava"
app_state:
gov:
deposit_params:
min_deposit:
- amount: "10000000"
denom: "ulava"
voting_params:
voting_period: "3s"
voting_period: "3s"
staking:
params:
bond_denom: "ulava"
mint:
params:
mint_denom: "ulava"
2 changes: 1 addition & 1 deletion cookbook/param_change_epoch_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"value": "8"
}
],
"deposit": "10000000stake"
"deposit": "10000000ulava"
}
2 changes: 1 addition & 1 deletion cookbook/spec_add_ethereum.json
Original file line number Diff line number Diff line change
Expand Up @@ -696,5 +696,5 @@
]
}
],
"deposit": "10000000stake"
"deposit": "10000000ulava"
}
2 changes: 1 addition & 1 deletion cookbook/spec_add_osmosis.json
Original file line number Diff line number Diff line change
Expand Up @@ -1762,5 +1762,5 @@
]
}
],
"deposit": "10000000stake"
"deposit": "10000000ulava"
}
2 changes: 1 addition & 1 deletion cookbook/spec_add_terra.json
Original file line number Diff line number Diff line change
Expand Up @@ -4666,5 +4666,5 @@
]
}
],
"deposit": "10000000stake"
"deposit": "10000000ulava"
}
2 changes: 1 addition & 1 deletion cookbook/spec_modify_ethereum.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,5 @@
]
}
],
"deposit": "10000000stake"
"deposit": "10000000ulava"
}
2 changes: 1 addition & 1 deletion cookbook/test_param_change.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
]
}
],
"deposit": "10000000stake"
"deposit": "10000000ulava"
}
File renamed without changes.
6 changes: 0 additions & 6 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13150,10 +13150,8 @@ paths:
properties:
minStakeProvider:
type: string
format: uint64
minStakeClient:
type: string
format: uint64
mintCoinsPerCU:
type: string
burnCoinsPerCU:
Expand Down Expand Up @@ -21005,10 +21003,8 @@ definitions:
properties:
minStakeProvider:
type: string
format: uint64
minStakeClient:
type: string
format: uint64
mintCoinsPerCU:
type: string
burnCoinsPerCU:
Expand Down Expand Up @@ -21351,10 +21347,8 @@ definitions:
properties:
minStakeProvider:
type: string
format: uint64
minStakeClient:
type: string
format: uint64
mintCoinsPerCU:
type: string
burnCoinsPerCU:
Expand Down
10 changes: 8 additions & 2 deletions proto/pairing/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ option go_package = "github.com/lavanet/lava/x/pairing/types";
message Params {
option (gogoproto.goproto_stringer) = false;

uint64 minStakeProvider = 1 [(gogoproto.moretags) = "yaml:\"min_stake_provider\""];
uint64 minStakeClient = 2 [(gogoproto.moretags) = "yaml:\"min_stake_client\""];
string minStakeProvider = 1 [(gogoproto.moretags) = "yaml:\"min_stake_provider\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin",
(gogoproto.nullable) = false
];
string minStakeClient = 2 [(gogoproto.moretags) = "yaml:\"min_stake_client\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin",
(gogoproto.nullable) = false
];
string mintCoinsPerCU = 3 [
(gogoproto.moretags) = "yaml:\"mint_coins_per_cu\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
Expand Down
File renamed without changes.
24 changes: 12 additions & 12 deletions .scripts/init.sh → scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ lavad tx gov vote 2 yes -y --from alice
sleep 4

#Ethereum providers
lavad tx pairing stake-provider "ETH1" 2010stake "127.0.0.1:2221,jsonrpc,1" 1 -y --from servicer1 &
lavad tx pairing stake-provider "ETH1" 2000stake "127.0.0.1:2222,jsonrpc,1" 1 -y --from servicer2 &
lavad tx pairing stake-provider "ETH1" 2050stake "127.0.0.1:2223,jsonrpc,1" 1 -y --from servicer3 &
lavad tx pairing stake-provider "ETH1" 2020stake "127.0.0.1:2224,jsonrpc,1" 1 -y --from servicer4 &
lavad tx pairing stake-provider "ETH1" 2030stake "127.0.0.1:2225,jsonrpc,1" 1 -y --from servicer5
lavad tx pairing stake-provider "ETH1" 2010ulava "127.0.0.1:2221,jsonrpc,1" 1 -y --from servicer1 &
lavad tx pairing stake-provider "ETH1" 2000ulava "127.0.0.1:2222,jsonrpc,1" 1 -y --from servicer2 &
lavad tx pairing stake-provider "ETH1" 2050ulava "127.0.0.1:2223,jsonrpc,1" 1 -y --from servicer3 &
lavad tx pairing stake-provider "ETH1" 2020ulava "127.0.0.1:2224,jsonrpc,1" 1 -y --from servicer4 &
lavad tx pairing stake-provider "ETH1" 2030ulava "127.0.0.1:2225,jsonrpc,1" 1 -y --from servicer5

#Terra providers
lavad tx pairing stake-provider "COS3" 2010stake "127.0.0.1:2241,tendermintrpc,1 127.0.0.1:2231,rest,1" 1 -y --from servicer1 &
lavad tx pairing stake-provider "COS3" 2000stake "127.0.0.1:2242,tendermintrpc,1 127.0.0.1:2232,rest,1" 1 -y --from servicer2 &
lavad tx pairing stake-provider "COS3" 2050stake "127.0.0.1:2243,tendermintrpc,1 127.0.0.1:2233,rest,1" 1 -y --from servicer3
# lavad tx pairing stake-provider "COS1" 2020stake "127.0.0.1:2244,tendermintrpc,1 127.0.0.1:2234,rest,1" 1 -y --from servicer4
# lavad tx pairing stake-provider "COS1" 2030stake "127.0.0.1:2245,tendermintrpc,1 127.0.0.1:2235,rest,1" 1 -y --from servicer5
lavad tx pairing stake-provider "COS3" 2010ulava "127.0.0.1:2241,tendermintrpc,1 127.0.0.1:2231,rest,1" 1 -y --from servicer1 &
lavad tx pairing stake-provider "COS3" 2000ulava "127.0.0.1:2242,tendermintrpc,1 127.0.0.1:2232,rest,1" 1 -y --from servicer2 &
lavad tx pairing stake-provider "COS3" 2050ulava "127.0.0.1:2243,tendermintrpc,1 127.0.0.1:2233,rest,1" 1 -y --from servicer3
# lavad tx pairing stake-provider "COS1" 2020ulava "127.0.0.1:2244,tendermintrpc,1 127.0.0.1:2234,rest,1" 1 -y --from servicer4
# lavad tx pairing stake-provider "COS1" 2030ulava "127.0.0.1:2245,tendermintrpc,1 127.0.0.1:2235,rest,1" 1 -y --from servicer5

lavad tx pairing stake-client "ETH1" 200000stake 1 -y --from user1
lavad tx pairing stake-client "COS3" 200000stake 1 -y --from user2
lavad tx pairing stake-client "ETH1" 200000ulava 1 -y --from user1
lavad tx pairing stake-client "COS3" 200000ulava 1 -y --from user2

echo "---------------ETH1 Queries------------------"
lavad query pairing providers "ETH1"
Expand Down
24 changes: 12 additions & 12 deletions init_chain_commands.sh → scripts/init_chain_commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ lavad tx gov vote 2 yes -y --from alice
sleep 4

#Ethereum providers
lavad tx pairing stake-provider "ETH1" 2010stake "127.0.0.1:2221,jsonrpc,1" 1 -y --from servicer1
lavad tx pairing stake-provider "ETH1" 2000stake "127.0.0.1:2222,jsonrpc,1" 1 -y --from servicer2
lavad tx pairing stake-provider "ETH1" 2050stake "127.0.0.1:2223,jsonrpc,1" 1 -y --from servicer3
lavad tx pairing stake-provider "ETH1" 2020stake "127.0.0.1:2224,jsonrpc,1" 1 -y --from servicer4
lavad tx pairing stake-provider "ETH1" 2030stake "127.0.0.1:2225,jsonrpc,1" 1 -y --from servicer5
lavad tx pairing stake-provider "ETH1" 2010ulava "127.0.0.1:2221,jsonrpc,1" 1 -y --from servicer1
lavad tx pairing stake-provider "ETH1" 2000ulava "127.0.0.1:2222,jsonrpc,1" 1 -y --from servicer2
lavad tx pairing stake-provider "ETH1" 2050ulava "127.0.0.1:2223,jsonrpc,1" 1 -y --from servicer3
lavad tx pairing stake-provider "ETH1" 2020ulava "127.0.0.1:2224,jsonrpc,1" 1 -y --from servicer4
lavad tx pairing stake-provider "ETH1" 2030ulava "127.0.0.1:2225,jsonrpc,1" 1 -y --from servicer5

#Terra providers
lavad tx pairing stake-provider "COS3" 2010stake "127.0.0.1:2241,tendermintrpc,1 127.0.0.1:2231,rest,1" 1 -y --from servicer1
lavad tx pairing stake-provider "COS3" 2000stake "127.0.0.1:2242,tendermintrpc,1 127.0.0.1:2232,rest,1" 1 -y --from servicer2
lavad tx pairing stake-provider "COS3" 2050stake "127.0.0.1:2243,tendermintrpc,1 127.0.0.1:2233,rest,1" 1 -y --from servicer3
# lavad tx pairing stake-provider "COS1" 2020stake "127.0.0.1:2244,tendermintrpc,1 127.0.0.1:2234,rest,1" 1 -y --from servicer4
# lavad tx pairing stake-provider "COS1" 2030stake "127.0.0.1:2245,tendermintrpc,1 127.0.0.1:2235,rest,1" 1 -y --from servicer5
lavad tx pairing stake-provider "COS3" 2010ulava "127.0.0.1:2241,tendermintrpc,1 127.0.0.1:2231,rest,1" 1 -y --from servicer1
lavad tx pairing stake-provider "COS3" 2000ulava "127.0.0.1:2242,tendermintrpc,1 127.0.0.1:2232,rest,1" 1 -y --from servicer2
lavad tx pairing stake-provider "COS3" 2050ulava "127.0.0.1:2243,tendermintrpc,1 127.0.0.1:2233,rest,1" 1 -y --from servicer3
# lavad tx pairing stake-provider "COS1" 2020ulava "127.0.0.1:2244,tendermintrpc,1 127.0.0.1:2234,rest,1" 1 -y --from servicer4
# lavad tx pairing stake-provider "COS1" 2030ulava "127.0.0.1:2245,tendermintrpc,1 127.0.0.1:2235,rest,1" 1 -y --from servicer5

lavad tx pairing stake-client "ETH1" 200000stake 1 -y --from user1
lavad tx pairing stake-client "COS3" 200000stake 1 -y --from user2
lavad tx pairing stake-client "ETH1" 200000ulava 1 -y --from user1
lavad tx pairing stake-client "COS3" 200000ulava 1 -y --from user2

echo "---------------Queries------------------"
lavad query pairing providers "ETH1"
Expand Down
6 changes: 3 additions & 3 deletions init_full.sh → scripts/init_full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
##############################

### Init chain commands
sh .scripts/init.sh
sh scripts/init.sh

### Run Providers (with mock proxies)
sh .scripts/eth.sh &
sh .scripts/osmosis.sh &
sh scripts/eth.sh &
sh scripts/osmosis.sh &

# For debug peroses - if you see stopwatch this providers are still running
# stopwatch &
Expand Down
4 changes: 2 additions & 2 deletions lava.sh → scripts/lava.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

echo ' ::: SERVING LAVA CHAIN (starport 0.19.2) :::'
### Serve chain
sh ./.scripts/serve_chain.sh &
sh ./scripts/serve_chain.sh &
#TODO await event
echo ' ::: AWITING LAVA CHAIN ::: (40 secs) '
sleep 40
Expand All @@ -21,7 +21,7 @@ sh init_full.sh
echo ' ::: AWITING FOR PROVIDERS ::: (40 secs)'
echo ' ::: RUNNING INITFULL - SPECS, PROXIES, MOCK PROVIDERS :::'
sleep 40
sh ./.scripts/run_clients.sh
sh ./scripts/run_clients.sh

echo ' ::: DONE - FINISHED CLIENTS :::'
echo ''
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion .scripts/serve_chain.sh → scripts/serve_chain.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(cd $LAVA && starport chain serve -v -r) 2>&1 | grep -e lava_ -e ERR_ -e STARPORT] -e !
(cd $LAVA && starport chain serve -v -r) 2>&1 | grep -e lava_ -e ERR_ -e STARPORT] -e ! -e panic -e Error
8 changes: 4 additions & 4 deletions testutil/e2e/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ $ cd $LAVA && ./lava.sh # Runs Everything, Lava, init, pro
### Start Proxies & Mock Providers
```
# ETH
$ ./.scripts/mock_proxy_eth.sh # will start proxies for eth
$ ./.scripts/providers_eth_mock.sh # will run eth providers directed towards the proxies
$ ./scripts/mock_proxy_eth.sh # will start proxies for eth
$ ./scripts/providers_eth_mock.sh # will run eth providers directed towards the proxies
# OSMOSIS
$ ./.scripts/mock_proxy_osmosis.sh # will start proxies for osmosis
$ ./.scripts/providers_osmosis_mock.sh # will run osmosis providers directed towards the proxies
$ ./scripts/mock_proxy_osmosis.sh # will start proxies for osmosis
$ ./scripts/providers_osmosis_mock.sh # will run osmosis providers directed towards the proxies
```

### Start & Use Generic Proxy Server
Expand Down
36 changes: 23 additions & 13 deletions testutil/e2e/Xconfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,49 @@ build:
main: "cmd/lavad"
accounts:
- name: alice
coins: ["20000token", "200000000000stake"]
coins: ["200000000000ulava"]
- name: bob
coins: ["10000token", "100000000stake"]
coins: ["100000000ulava"]
- name: user1
coins: ["10000token", "200000000stake"]
coins: ["200000000ulava"]
- name: user2
coins: ["10000token", "200000000stake"]
coins: ["200000000ulava"]
- name: user3
coins: ["10000token", "200000000stake"]
coins: ["200000000ulava"]
- name: servicer1
coins: ["10000token", "200000000stake"]
coins: ["200000000ulava"]
- name: servicer2
coins: ["10000token", "200000000stake"]
coins: ["200000000ulava"]
- name: servicer3
coins: ["10000token", "200000000stake"]
coins: ["200000000ulava"]
- name: servicer4
coins: ["10000token", "200000000stake"]
coins: ["200000000ulava"]
- name: servicer5
coins: ["10000token", "200000000stake"]
coins: ["200000000ulava"]
validator:
name: alice
staked: "100000000000stake"
staked: "100000000000ulava"
client:
openapi:
path: "docs/static/openapi.yml"
vuex:
path: "vue/src/store"
faucet:
name: bob
coins: ["5token", "100000stake"]
coins: ["100000ulava"]
genesis:
chain_id: "lava"
app_state:
gov:
deposit_params:
min_deposit:
- amount: "10000000"
denom: "ulava"
voting_params:
voting_period: "3s"
voting_period: "3s"
staking:
params:
bond_denom: "ulava"
mint:
params:
mint_denom: "ulava"
6 changes: 3 additions & 3 deletions testutil/e2e/lava_fullflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func FullFlowTest(t *testing.T) ([]TestResult, error) {
init := LogProcess(CMD{
stateID: "init",
homepath: homepath,
cmd: "./.scripts/init.sh",
cmd: "./scripts/init.sh",
filter: []string{":::", "raw_log", "Error", "error", "panic"},
testing: true,
test: initTest,
Expand Down Expand Up @@ -194,7 +194,7 @@ func FullFlowTest(t *testing.T) ([]TestResult, error) {
stateID: "providers_osmosis",
homepath: homepath,
// cmd: "./providers_osmosis.sh",
cmd: "./.scripts/osmosis.sh", // with mock
cmd: "./scripts/osmosis.sh", // with mock
filter: []string{"updated", "server", "error"},
testing: true,
test: providersTest,
Expand Down Expand Up @@ -317,7 +317,7 @@ func FullFlowTest(t *testing.T) ([]TestResult, error) {
stateID: "providers_eth",
homepath: homepath,
// cmd: "./providers_eth.sh",
cmd: "./.scripts/eth.sh", // with mock
cmd: "./scripts/eth.sh", // with mock
filter: []string{"updated", "server", "error"},
testing: true,
test: providersTest,
Expand Down
2 changes: 2 additions & 0 deletions x/epochstorage/types/types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package types

const TokenDenom = "ulava"

//returns a deep copy of the stake storage with the same index
func (stksto StakeStorage) Copy() (returnedStorage StakeStorage) {
returnedStorage = StakeStorage{Index: stksto.Index, StakeEntries: []StakeEntry{}}
Expand Down
Loading

0 comments on commit fb0455c

Please sign in to comment.