Skip to content

Commit

Permalink
update sp module
Browse files Browse the repository at this point in the history
  • Loading branch information
forcodedancing committed Aug 9, 2023
1 parent 8bf45ff commit f7b2714
Show file tree
Hide file tree
Showing 25 changed files with 740 additions and 218 deletions.
5 changes: 3 additions & 2 deletions app/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package app_test
import (
"testing"

"github.com/bnb-chain/greenfield/sdk/client/test"
"github.com/bnb-chain/greenfield/testutil"
dbm "github.com/cometbft/cometbft-db"
"github.com/cometbft/cometbft/libs/log"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"

"github.com/bnb-chain/greenfield/sdk/client/test"
"github.com/bnb-chain/greenfield/testutil"
)

func TestExportAppStateAndValidators(t *testing.T) {
Expand Down
2 changes: 2 additions & 0 deletions deployment/localup/localup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ function generate_genesis() {
sed -i -e "s/\"discontinue_confirm_period\": \"604800\"/\"discontinue_confirm_period\": \"5\"/g" ${workspace}/.local/validator${i}/config/genesis.json
sed -i -e "s/\"discontinue_deletion_max\": \"100\"/\"discontinue_deletion_max\": \"2\"/g" ${workspace}/.local/validator${i}/config/genesis.json
sed -i -e "s/\"voting_period\": \"30s\"/\"voting_period\": \"5s\"/g" ${workspace}/.local/validator${i}/config/genesis.json
sed -i -e "s/\"update_global_price_interval\": \"2592000\"/\"update_global_price_interval\": \"1\"/g" ${workspace}/.local/validator${i}/config/genesis.json
sed -i -e "s/\"max_update_price_times\": 3/\"max_update_price_times\": 1000000/g" ${workspace}/.local/validator${i}/config/genesis.json
#sed -i -e "s/\"community_tax\": \"0.020000000000000000\"/\"community_tax\": \"0\"/g" ${workspace}/.local/validator${i}/config/genesis.json
sed -i -e "s/log_level = \"info\"/\log_level= \"debug\"/g" ${workspace}/.local/validator${i}/config/config.toml
done
Expand Down
2 changes: 1 addition & 1 deletion e2e/core/basesuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (s *BaseSuite) InitChain() {
func (s *BaseSuite) SetupSuite() {
s.Config = InitConfig()
initValidatorOnce.Do(func() {
s.InitChain()
//s.InitChain()
})

s.Client, _ = client.NewGreenfieldClient(s.Config.TendermintAddr, s.Config.ChainId)
Expand Down
3 changes: 1 addition & 2 deletions e2e/tests/payment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import (
"testing"
"time"

"github.com/cosmos/cosmos-sdk/types/query"

sdkmath "cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/query"
"github.com/cosmos/cosmos-sdk/types/tx"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
Expand Down
375 changes: 343 additions & 32 deletions e2e/tests/storage_bill_test.go

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions e2e/tests/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import (
"testing"
"time"

sptypes "github.com/bnb-chain/greenfield/x/sp/types"

sdkmath "cosmossdk.io/math"
ctypes "github.com/cometbft/cometbft/rpc/core/types"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand All @@ -29,6 +27,7 @@ import (
"github.com/bnb-chain/greenfield/sdk/keys"
"github.com/bnb-chain/greenfield/sdk/types"
storageutils "github.com/bnb-chain/greenfield/testutil/storage"
sptypes "github.com/bnb-chain/greenfield/x/sp/types"
storagetypes "github.com/bnb-chain/greenfield/x/storage/types"
types2 "github.com/bnb-chain/greenfield/x/virtualgroup/types"
)
Expand Down
4 changes: 4 additions & 0 deletions proto/greenfield/sp/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ message Params {
int64 maintenance_duration_quota = 5 [(gogoproto.moretags) = "yaml:\"maintenance_duration_quota\""];
// the number of blocks to be wait for sp to be in maintenance mode again if already requested
int64 num_of_lockup_blocks_for_maintenance = 6 [(gogoproto.moretags) = "yaml:\"num_of_lockup_blocks_for_maintenance\""];
// the time interval to update global storage price
uint64 update_global_price_interval = 7 [(gogoproto.moretags) = "yaml:\"update_global_price_interval\""];
// the max times allowed to update price during an interval
uint32 max_update_price_times = 8 [(gogoproto.moretags) = "yaml:\"max_update_price_times\""];
}
Loading

0 comments on commit f7b2714

Please sign in to comment.