mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-30 05:01:44 +00:00
network > chain_id, put in genesis.json
This commit is contained in:
@ -16,7 +16,7 @@ Consensus State Machine Overview:
|
||||
* The NewHeight is a transition period after the height is incremented,
|
||||
where the node still receives late commits before potentially proposing.
|
||||
The height should be incremented because a block had been
|
||||
"committed by the network", and clients should see that
|
||||
"committed by the chain_id", and clients should see that
|
||||
reflected as a new height.
|
||||
|
||||
+-------------------------------------+
|
||||
@ -656,7 +656,7 @@ func (cs *ConsensusState) RunActionPropose(height uint, round uint) {
|
||||
txs := cs.mempoolReactor.Mempool.GetProposalTxs()
|
||||
block = &types.Block{
|
||||
Header: &types.Header{
|
||||
Network: config.GetString("network"),
|
||||
ChainID: config.GetString("chain_id"),
|
||||
Height: cs.Height,
|
||||
Time: time.Now(),
|
||||
Fees: 0, // TODO fees
|
||||
|
@ -39,8 +39,8 @@ func (p *Proposal) String() string {
|
||||
}
|
||||
|
||||
func (p *Proposal) WriteSignBytes(w io.Writer, n *int64, err *error) {
|
||||
// We hex encode the network name so we don't deal with escaping issues.
|
||||
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.GetString("network"))), w, n, err)
|
||||
// We hex encode the chain_id name so we don't deal with escaping issues.
|
||||
binary.WriteTo([]byte(Fmt(`{"chain_id":"%X"`, config.GetString("chain_id"))), w, n, err)
|
||||
binary.WriteTo([]byte(`,"proposal":{"block_parts":`), w, n, err)
|
||||
p.BlockParts.WriteSignBytes(w, n, err)
|
||||
binary.WriteTo([]byte(Fmt(`,"height":%v,"pol_parts":`, p.Height)), w, n, err)
|
||||
|
@ -19,8 +19,8 @@ func TestProposalSignable(t *testing.T) {
|
||||
}
|
||||
signBytes := account.SignBytes(proposal)
|
||||
signStr := string(signBytes)
|
||||
expected := Fmt(`{"network":"%X","proposal":{"block_parts":{"hash":"626C6F636B7061727473","total":111},"height":12345,"pol_parts":{"hash":"706F6C7061727473","total":222},"round":23456}}`,
|
||||
config.GetString("network"))
|
||||
expected := Fmt(`{"chain_id":"%X","proposal":{"block_parts":{"hash":"626C6F636B7061727473","total":111},"height":12345,"pol_parts":{"hash":"706F6C7061727473","total":222},"round":23456}}`,
|
||||
config.GetString("chain_id"))
|
||||
if signStr != expected {
|
||||
t.Errorf("Got unexpected sign string for SendTx. Expected:\n%v\nGot:\n%v", expected, signStr)
|
||||
}
|
||||
|
Reference in New Issue
Block a user