Browse Source

Merge pull request #721 from tendermint/564-add-app-options-to-genesis-resp

Add app_options to GenesisDoc
pull/730/merge
Ethan Buchman 7 years ago
committed by GitHub
parent
commit
87cc277b38
4 changed files with 9 additions and 4 deletions
  1. +5
    -1
      CHANGELOG.md
  2. +2
    -1
      types/genesis.go
  3. +1
    -1
      types/genesis_test.go
  4. +1
    -1
      types/validator_set_test.go

+ 5
- 1
CHANGELOG.md View File

@ -28,7 +28,11 @@ BUG FIXES:
- Graceful handling/recovery for apps that have non-determinism or fail to halt
- Graceful handling/recovery for violations of safety, or liveness
## 0.12.0 (TBA)
## 0.12.0 (TBD)
IMPROVEMENTS:
- genesis doc: added `app_options` field, which, along with the other fields,
will be returned upon `/genesis` rpc call.
## 0.11.1 (October 10, 2017)


+ 2
- 1
types/genesis.go View File

@ -7,7 +7,7 @@ import (
"github.com/pkg/errors"
"github.com/tendermint/go-crypto"
crypto "github.com/tendermint/go-crypto"
"github.com/tendermint/go-wire/data"
cmn "github.com/tendermint/tmlibs/common"
)
@ -29,6 +29,7 @@ type GenesisDoc struct {
ConsensusParams *ConsensusParams `json:"consensus_params,omitempty"`
Validators []GenesisValidator `json:"validators"`
AppHash data.Bytes `json:"app_hash"`
AppOptions interface{} `json:"app_options,omitempty"`
}
// SaveAs is a utility method for saving GenensisDoc as a JSON file.


+ 1
- 1
types/genesis_test.go View File

@ -30,7 +30,7 @@ func TestGenesis(t *testing.T) {
}
// test a good one by raw json
genDocBytes := []byte(`{"genesis_time":"0001-01-01T00:00:00Z","chain_id":"test-chain-QDKdJr","consensus_params":null,"validators":[{"pub_key":{"type":"ed25519","data":"961EAB8752E51A03618502F55C2B6E09C38C65635C64CCF3173ED452CF86C957"},"power":10,"name":""}],"app_hash":""}`)
genDocBytes := []byte(`{"genesis_time":"0001-01-01T00:00:00Z","chain_id":"test-chain-QDKdJr","consensus_params":null,"validators":[{"pub_key":{"type":"ed25519","data":"961EAB8752E51A03618502F55C2B6E09C38C65635C64CCF3173ED452CF86C957"},"power":10,"name":""}],"app_hash":"","app_options":{"account_owner": "Bob"}}`)
_, err := GenesisDocFromJSON(genDocBytes)
assert.NoError(t, err, "expected no error for good genDoc json")


+ 1
- 1
types/validator_set_test.go View File

@ -5,8 +5,8 @@ import (
"strings"
"testing"
cmn "github.com/tendermint/tmlibs/common"
"github.com/tendermint/go-crypto"
cmn "github.com/tendermint/tmlibs/common"
)
func randPubKey() crypto.PubKey {


Loading…
Cancel
Save