Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ import (
"cosmossdk.io/client/v2/autocli"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/log"
"cosmossdk.io/math"
storetypes "cosmossdk.io/store/types"
"cosmossdk.io/x/evidence"
evidencekeeper "cosmossdk.io/x/evidence/keeper"
Expand Down Expand Up @@ -893,31 +892,6 @@ func (app *App) preBlocker(ph *ProposalHandler) func(ctx sdk.Context, _ *abci.Re
if err != nil {
return nil, err
}
if ctx.BlockHeight() == 1062219+1 {
bondedPoolBal := app.BankKeeper.GetBalance(ctx, authtypes.NewModuleAddress(stakingtypes.BondedPoolName), "loya")
vals, err := app.StakingKeeper.GetValidators(ctx, 7) // only 6 validators exist
if err != nil {
return nil, err
}
bondedtotal := math.ZeroInt()
notbondedtotal := math.ZeroInt()
for _, v := range vals {
if v.IsBonded() {
bondedtotal = bondedtotal.Add(v.Tokens)
} else {
notbondedtotal = notbondedtotal.Add(v.Tokens)
}
}
// transfer amount should be 1950000000
// "spendable balance 97171770000loya is smaller than 99121770000loya
transferAmt := bondedPoolBal.Amount.Sub(bondedtotal)
if transferAmt.Equal(math.NewInt(1950000000)) { // manually checked amount
err = app.BankKeeper.SendCoinsFromModuleToModule(ctx, stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, sdk.NewCoins(sdk.NewCoin("loya", transferAmt)))
if err != nil {
return nil, err
}
}
}

changed := res.ConsensusParamsChanged

Expand Down
9 changes: 9 additions & 0 deletions start_scripts/start_a_chain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ jq '.app_state.gov.params.min_deposit[0].denom = "loya"' $HOME_DIR/bill/config/g
jq '.app_state.gov.params.min_deposit[0].amount = "100"' $HOME_DIR/bill/config/genesis.json > temp.json && mv temp.json $HOME_DIR/bill/config/genesis.json
jq '.app_state.gov.params.expedited_voting_period = "30s"' $HOME_DIR/bill/config/genesis.json > temp.json && mv temp.json $HOME_DIR/bill/config/genesis.json

# Add TRBBridgeV2 data spec to genesis so local bridge tests work without runtime registration
echo "Adding TRBBridgeV2 data spec to genesis..."
echo "main..."
jq --slurpfile trbbridgev2_spec start_scripts/test_jsons/trbbridgev2_ds.json 'if any((.app_state.registry.dataspec // [])[]; (.query_type | ascii_downcase) == "trbbridgev2") then . else .app_state.registry.dataspec = ((.app_state.registry.dataspec // []) + [$trbbridgev2_spec[0]]) end' $HOME_DIR/config/genesis.json > temp.json && mv temp.json $HOME_DIR/config/genesis.json
echo "$KEY_NAME..."
jq --slurpfile trbbridgev2_spec start_scripts/test_jsons/trbbridgev2_ds.json 'if any((.app_state.registry.dataspec // [])[]; (.query_type | ascii_downcase) == "trbbridgev2") then . else .app_state.registry.dataspec = ((.app_state.registry.dataspec // []) + [$trbbridgev2_spec[0]]) end' $HOME_DIR/$KEY_NAME/config/genesis.json > temp.json && mv temp.json $HOME_DIR/$KEY_NAME/config/genesis.json
echo "bill..."
jq --slurpfile trbbridgev2_spec start_scripts/test_jsons/trbbridgev2_ds.json 'if any((.app_state.registry.dataspec // [])[]; (.query_type | ascii_downcase) == "trbbridgev2") then . else .app_state.registry.dataspec = ((.app_state.registry.dataspec // []) + [$trbbridgev2_spec[0]]) end' $HOME_DIR/bill/config/genesis.json > temp.json && mv temp.json $HOME_DIR/bill/config/genesis.json

# Create a tx to give alice loyas to stake
echo "Adding genesis accounts..."
echo "$KEY_NAME..."
Expand Down
18 changes: 18 additions & 0 deletions start_scripts/test_jsons/trbbridgev2_ds.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"document_hash": "TRBBridgeV2",
"query_type": "TRBBridgeV2",
"response_value_type": "address, string, uint256, uint256",
"abi_components": [
{
"name": "toLayer",
"field_type": "bool"
},
{
"name": "depositId",
"field_type": "uint256"
}
],
"aggregation_method": "weighted-mode",
"registrar": "tellor1alcefjzkk37qmfrnel8q4eruyll0pc8arxhxxw",
"report_block_window": 2000
}
Loading
Loading