Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
fix nontestnet init (#432)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stumble authored Oct 29, 2019
1 parent 94cd961 commit ad1238e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
6 changes: 2 additions & 4 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,7 @@ func (lb *LinoBlockchain) toAppAccount(ctx sdk.Context, ga GenesisAccount) sdk.E
// convert GenesisDeveloper to AppDeveloper
func (lb *LinoBlockchain) toAppDeveloper(
ctx sdk.Context, developer GenesisAppDeveloper) sdk.Error {
// TODO(yumin): this is broke. App must first stake then it apply for app.
// this should be implemented after vote module is ready.
panic("Unimplemetend genesis to app developer")
// skipped.
// if !lb.accountManager.DoesAccountExist(ctx, types.AccountKey(developer.Name)) {
// return ErrGenesisFailed("genesis developer account doesn't exist")
// }
Expand All @@ -415,7 +413,7 @@ func (lb *LinoBlockchain) toAppDeveloper(
// developer.Description, developer.AppMetaData); err != nil {
// return err
// }
// return nil
return nil
}

// init process for a block, execute time events and fire incompetent validators
Expand Down
12 changes: 6 additions & 6 deletions app/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func LinoBlockchainGenTx(cdc *wire.Codec, pk crypto.PubKey) (
fmt.Println("tx private key is:", strings.ToUpper(hex.EncodeToString(txKey.Bytes())))
fmt.Println("sign private key is:", strings.ToUpper(hex.EncodeToString(signKey.Bytes())))

totalCoin := types.NewCoinFromInt64(10000000000 * types.Decimals)
totalCoin := types.NewCoinFromInt64(100000000 * types.Decimals)
genesisAcc := GenesisAccount{
Name: "lino",
Coin: totalCoin,
Expand All @@ -137,7 +137,7 @@ func LinoBlockchainGenTx(cdc *wire.Codec, pk crypto.PubKey) (

validator = tmtypes.GenesisValidator{
PubKey: pk,
Power: 1000,
Power: 200000,
}
return
}
Expand Down Expand Up @@ -178,9 +178,9 @@ func LinoBlockchainGenState(cdc *wire.Codec, appGenTxs []json.RawMessage) (appSt
true,
param.GlobalAllocationParam{
GlobalGrowthRate: types.NewDecFromRat(98, 1000),
ContentCreatorAllocation: types.NewDecFromRat(65, 100),
DeveloperAllocation: types.NewDecFromRat(10, 100),
ValidatorAllocation: types.NewDecFromRat(5, 100),
ContentCreatorAllocation: types.NewDecFromRat(10, 100),
DeveloperAllocation: types.NewDecFromRat(70, 100),
ValidatorAllocation: types.NewDecFromRat(20, 100),
},
param.VoteParam{
MinStakeIn: types.NewCoinFromInt64(1000 * types.Decimals),
Expand Down Expand Up @@ -278,7 +278,7 @@ func LinoBlockchainGenState(cdc *wire.Codec, appGenTxs []json.RawMessage) (appSt
genesisState.Accounts = append(genesisState.Accounts, genesisAcc)
}
genesisAppDeveloper := GenesisAppDeveloper{
Name: "lino",
Name: "linoapp",
Website: "https://lino.network/",
Description: "",
AppMetaData: "",
Expand Down
8 changes: 4 additions & 4 deletions app/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ func TestGetGenesisJson(t *testing.T) {
true,
param.GlobalAllocationParam{
GlobalGrowthRate: types.NewDecFromRat(98, 1000),
ContentCreatorAllocation: types.NewDecFromRat(85, 100),
DeveloperAllocation: types.NewDecFromRat(10, 100),
ValidatorAllocation: types.NewDecFromRat(5, 100),
ContentCreatorAllocation: types.NewDecFromRat(10, 100),
DeveloperAllocation: types.NewDecFromRat(70, 100),
ValidatorAllocation: types.NewDecFromRat(20, 100),
},
param.VoteParam{
MinStakeIn: types.NewCoinFromInt64(1000 * types.Decimals),
Expand Down Expand Up @@ -190,7 +190,7 @@ func TestLinoBlockchainGenTx(t *testing.T) {
err = cdc.UnmarshalJSON(appGenTx, &genesisAcc)
assert.Nil(t, err)
assert.Equal(t, genesisAcc.Name, "lino")
assert.Equal(t, genesisAcc.Coin, types.NewCoinFromInt64(10000000000*types.Decimals))
assert.Equal(t, genesisAcc.Coin, types.NewCoinFromInt64(100000000*types.Decimals))
assert.Equal(t, genesisAcc.IsValidator, true)
assert.Equal(t, genesisAcc.ValPubKey, pk)
assert.Equal(t, validator.PubKey, pk)
Expand Down

0 comments on commit ad1238e

Please sign in to comment.