Skip to content

Commit

Permalink
fix: CNS-fix-LAV1-dev (#1378)
Browse files Browse the repository at this point in the history
* remove verifications in dev env

* fix

* another fix

* another another fix

* fix spec count

* fix spec count

---------

Co-authored-by: Yarom Swisa <[email protected] git config --global user.name Yarom>
Co-authored-by: Ran Mishael <[email protected]>
  • Loading branch information
3 people authored Apr 15, 2024
1 parent d0431f9 commit e90127e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scripts/init_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GASPRICE="0.000000001ulava"

# Specs proposal
echo ---- Specs proposal ----
lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/spec_add_ethereum.json,./cookbook/specs/spec_add_ibc.json,./cookbook/specs/spec_add_cosmossdk.json,./cookbook/specs/spec_add_lava.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/spec_add_ethereum.json,./cookbook/specs/spec_add_cosmoswasm.json,./cookbook/specs/spec_add_ibc.json,./cookbook/specs/spec_add_cosmossdk.json,./cookbook/specs/spec_add_cosmossdk_full.json,./cookbook/specs/spec_add_lava.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
wait_next_block
lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
sleep 6 # need to sleep because plan policies need the specs when setting chain policies verifications
Expand Down
2 changes: 1 addition & 1 deletion scripts/init_payment_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source $__dir/useful_commands.sh
GASPRICE="0.000000001ulava"

# Specs proposal
lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/spec_add_ibc.json,./cookbook/specs/spec_add_cosmossdk.json,./cookbook/specs/spec_add_lava.json -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
lavad tx gov submit-legacy-proposal spec-add ./cookbook/specs/spec_add_cosmoswasm.json,./cookbook/specs/spec_add_ibc.json,./cookbook/specs/spec_add_cosmossdk.json,./cookbook/specs/spec_add_cosmossdk_full.json,./cookbook/specs/spec_add_lava.json --lava-dev-test -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
wait_next_block
lavad tx gov deposit 1 100ulava -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
wait_next_block
Expand Down
2 changes: 1 addition & 1 deletion testutil/e2e/paymentE2E.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ func runPaymentE2E(timeout time.Duration) {
// - produce 1 staked client (for LAV1)
// - produce 1 subscription (for LAV1)

lt.checkStakeLava(1, 3, 1, 2, checkedPlansE2E, []string{"LAV1"}, []string{"user1"}, "Staking Lava OK")
lt.checkStakeLava(1, 5, 1, 2, checkedPlansE2E, []string{"LAV1"}, []string{"user1"}, "Staking Lava OK")

// get balance of providers right after stake for payment check later
providers, err := lt.getProvidersAddresses()
Expand Down
4 changes: 2 additions & 2 deletions testutil/e2e/protocolE2E.go
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ func (lt *lavaTest) lavaOverLava(ctx context.Context) {
// - produce 5 specs: ETH1, HOL1, SEP1, IBC, COSMOSSDK, LAV1 (via spec_add_{ethereum,cosmoshub,lava})
// - produce 2 plans: "DefaultPlan", "EmergencyModePlan"

lt.checkStakeLava(2, 6, 4, 5, checkedPlansE2E, checkedSpecsE2ELOL, checkedSubscriptionsLOL, "Lava Over Lava Test OK")
lt.checkStakeLava(2, 8, 4, 5, checkedPlansE2E, checkedSpecsE2ELOL, checkedSubscriptionsLOL, "Lava Over Lava Test OK")
}

func (lt *lavaTest) checkRESTConsumer(rpcURL string, timeout time.Duration) {
Expand Down Expand Up @@ -1224,7 +1224,7 @@ func runProtocolE2E(timeout time.Duration) {
// - produce 1 staked client (for each of ETH1, LAV1)
// - produce 1 subscription (for both ETH1, LAV1)

lt.checkStakeLava(2, 6, 4, 5, checkedPlansE2E, checkedSpecsE2E, checkedSubscriptions, "Staking Lava OK")
lt.checkStakeLava(2, 8, 4, 5, checkedPlansE2E, checkedSpecsE2E, checkedSubscriptions, "Staking Lava OK")

utils.LavaFormatInfo("RUNNING TESTS")

Expand Down
2 changes: 1 addition & 1 deletion testutil/e2e/sdkE2E.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func runSDKE2E(timeout time.Duration) {
utils.LavaFormatInfo("Staking Lava")
lt.stakeLava(ctx)

lt.checkStakeLava(2, 6, 4, 5, checkedPlansE2E, checkedSpecsE2E, checkedSubscriptions, "Staking Lava OK")
lt.checkStakeLava(2, 8, 4, 5, checkedPlansE2E, checkedSpecsE2E, checkedSubscriptions, "Staking Lava OK")

utils.LavaFormatInfo("RUNNING TESTS")

Expand Down
10 changes: 10 additions & 0 deletions x/spec/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ $ %s tx gov spec-proposal spec-add <path/to/proposal.json> --from=<key_or_addres
if spec.Index == "LAV1" {
utilslib.LavaFormatInfo("modified lava spec time for dev tests")
content.Specs[idx].AverageBlockTime = (1 * time.Second).Milliseconds()
for collection := range content.Specs[idx].ApiCollections {
for verification := range content.Specs[idx].ApiCollections[collection].Verifications {
if content.Specs[idx].ApiCollections[collection].Verifications[verification].Name == "chain-id" {
content.Specs[idx].ApiCollections[collection].Verifications[verification].Values[0].ExpectedValue = "*"
}
if content.Specs[idx].ApiCollections[collection].Verifications[verification].Name == "pruning" {
content.Specs[idx].ApiCollections[collection].Verifications = append(content.Specs[idx].ApiCollections[collection].Verifications[:verification], content.Specs[idx].ApiCollections[collection].Verifications[verification+1:]...)
}
}
}
}
}
}
Expand Down

0 comments on commit e90127e

Please sign in to comment.