|
@ -132,7 +132,7 @@ type SendTx struct { |
|
|
|
|
|
|
|
|
func (tx *SendTx) WriteSignBytes(w io.Writer, n *int64, err *error) { |
|
|
func (tx *SendTx) WriteSignBytes(w io.Writer, n *int64, err *error) { |
|
|
// We hex encode the network name so we don't deal with escaping issues.
|
|
|
// We hex encode the network name so we don't deal with escaping issues.
|
|
|
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("Network"))), w, n, err) |
|
|
|
|
|
|
|
|
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("network"))), w, n, err) |
|
|
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"inputs":[`, TxTypeSend)), w, n, err) |
|
|
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"inputs":[`, TxTypeSend)), w, n, err) |
|
|
for i, in := range tx.Inputs { |
|
|
for i, in := range tx.Inputs { |
|
|
in.WriteSignBytes(w, n, err) |
|
|
in.WriteSignBytes(w, n, err) |
|
@ -166,7 +166,7 @@ type CallTx struct { |
|
|
|
|
|
|
|
|
func (tx *CallTx) WriteSignBytes(w io.Writer, n *int64, err *error) { |
|
|
func (tx *CallTx) WriteSignBytes(w io.Writer, n *int64, err *error) { |
|
|
// We hex encode the network name so we don't deal with escaping issues.
|
|
|
// We hex encode the network name so we don't deal with escaping issues.
|
|
|
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("Network"))), w, n, err) |
|
|
|
|
|
|
|
|
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("network"))), w, n, err) |
|
|
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"address":"%X","data":"%X"`, TxTypeCall, tx.Address, tx.Data)), w, n, err) |
|
|
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"address":"%X","data":"%X"`, TxTypeCall, tx.Address, tx.Data)), w, n, err) |
|
|
binary.WriteTo([]byte(Fmt(`,"fee":%v,"gas_limit":%v,"input":`, tx.Fee, tx.GasLimit)), w, n, err) |
|
|
binary.WriteTo([]byte(Fmt(`,"fee":%v,"gas_limit":%v,"input":`, tx.Fee, tx.GasLimit)), w, n, err) |
|
|
tx.Input.WriteSignBytes(w, n, err) |
|
|
tx.Input.WriteSignBytes(w, n, err) |
|
@ -187,7 +187,7 @@ type BondTx struct { |
|
|
|
|
|
|
|
|
func (tx *BondTx) WriteSignBytes(w io.Writer, n *int64, err *error) { |
|
|
func (tx *BondTx) WriteSignBytes(w io.Writer, n *int64, err *error) { |
|
|
// We hex encode the network name so we don't deal with escaping issues.
|
|
|
// We hex encode the network name so we don't deal with escaping issues.
|
|
|
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("Network"))), w, n, err) |
|
|
|
|
|
|
|
|
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("network"))), w, n, err) |
|
|
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"inputs":[`, TxTypeBond)), w, n, err) |
|
|
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"inputs":[`, TxTypeBond)), w, n, err) |
|
|
for i, in := range tx.Inputs { |
|
|
for i, in := range tx.Inputs { |
|
|
in.WriteSignBytes(w, n, err) |
|
|
in.WriteSignBytes(w, n, err) |
|
@ -221,7 +221,7 @@ type UnbondTx struct { |
|
|
|
|
|
|
|
|
func (tx *UnbondTx) WriteSignBytes(w io.Writer, n *int64, err *error) { |
|
|
func (tx *UnbondTx) WriteSignBytes(w io.Writer, n *int64, err *error) { |
|
|
// We hex encode the network name so we don't deal with escaping issues.
|
|
|
// We hex encode the network name so we don't deal with escaping issues.
|
|
|
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("Network"))), w, n, err) |
|
|
|
|
|
|
|
|
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("network"))), w, n, err) |
|
|
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"address":"%X","height":%v}]}`, TxTypeUnbond, tx.Address, tx.Height)), w, n, err) |
|
|
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"address":"%X","height":%v}]}`, TxTypeUnbond, tx.Address, tx.Height)), w, n, err) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -239,7 +239,7 @@ type RebondTx struct { |
|
|
|
|
|
|
|
|
func (tx *RebondTx) WriteSignBytes(w io.Writer, n *int64, err *error) { |
|
|
func (tx *RebondTx) WriteSignBytes(w io.Writer, n *int64, err *error) { |
|
|
// We hex encode the network name so we don't deal with escaping issues.
|
|
|
// We hex encode the network name so we don't deal with escaping issues.
|
|
|
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("Network"))), w, n, err) |
|
|
|
|
|
|
|
|
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("network"))), w, n, err) |
|
|
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"address":"%X","height":%v}]}`, TxTypeRebond, tx.Address, tx.Height)), w, n, err) |
|
|
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"address":"%X","height":%v}]}`, TxTypeRebond, tx.Address, tx.Height)), w, n, err) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|