mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-06 08:07:11 +00:00
fixes for chain id in nametx sign functions
This commit is contained in:
+2
-2
@@ -190,9 +190,9 @@ type NameTx struct {
|
||||
Fee uint64 `json:"fee"`
|
||||
}
|
||||
|
||||
func (tx *NameTx) WriteSignBytes(w io.Writer, n *int64, err *error) {
|
||||
func (tx *NameTx) WriteSignBytes(chainID string, 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)
|
||||
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, chainID)), w, n, err)
|
||||
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"name":"%s","data":"%s"`, TxTypeName, tx.Name, tx.Data)), w, n, err)
|
||||
binary.WriteTo([]byte(Fmt(`,"fee":%v,"input":`, tx.Fee)), w, n, err)
|
||||
tx.Input.WriteSignBytes(w, n, err)
|
||||
|
||||
+2
-2
@@ -127,9 +127,9 @@ func NewNameTxWithNonce(from account.PubKey, name, data string, amt, fee uint64,
|
||||
}
|
||||
}
|
||||
|
||||
func (tx *NameTx) Sign(privAccount *account.PrivAccount) {
|
||||
func (tx *NameTx) Sign(chainID string, privAccount *account.PrivAccount) {
|
||||
tx.Input.PubKey = privAccount.PubKey
|
||||
tx.Input.Signature = privAccount.Sign(tx)
|
||||
tx.Input.Signature = privAccount.Sign(chainID, tx)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user