Commit c9bcef33 authored by linj's avatar linj Committed by 33cn

record txhash in hex format

protobuf3 can't save non-utf8 in string
parent 227f5fbd
......@@ -5,6 +5,7 @@
package executor
import (
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/types"
pt "github.com/33cn/plugin/plugin/dapp/paracross/types"
)
......@@ -18,7 +19,7 @@ func (e *Paracross) ExecDelLocal_Commit(payload *pt.ParacrossCommitAction, tx *t
types.Decode(log.Log, &g)
var r pt.ParacrossTx
r.TxHash = string(tx.Hash())
r.TxHash = common.ToHex(tx.Hash())
set.KV = append(set.KV, &types.KeyValue{Key: calcLocalTxKey(g.Status.Title, g.Status.Height, tx.From()), Value: nil})
} else if log.Ty == pt.TyLogParacrossCommitDone {
var g pt.ReceiptParacrossDone
......@@ -41,7 +42,7 @@ func (e *Paracross) ExecDelLocal_Commit(payload *pt.ParacrossCommitAction, tx *t
types.Decode(log.Log, &g)
var r pt.ParacrossTx
r.TxHash = string(tx.Hash())
r.TxHash = common.ToHex(tx.Hash())
set.KV = append(set.KV, &types.KeyValue{Key: calcLocalTxKey(g.Status.Title, g.Status.Height, tx.From()), Value: nil})
}
}
......
......@@ -7,6 +7,7 @@ package executor
import (
"bytes"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/util"
pt "github.com/33cn/plugin/plugin/dapp/paracross/types"
......@@ -21,7 +22,7 @@ func (e *Paracross) ExecLocal_Commit(payload *pt.ParacrossCommitAction, tx *type
types.Decode(log.Log, &g)
var r pt.ParacrossTx
r.TxHash = string(tx.Hash())
r.TxHash = common.ToHex(tx.Hash())
set.KV = append(set.KV, &types.KeyValue{Key: calcLocalTxKey(g.Status.Title, g.Status.Height, tx.From()), Value: types.Encode(&r)})
} else if log.Ty == pt.TyLogParacrossCommitDone {
var g pt.ReceiptParacrossDone
......@@ -43,7 +44,7 @@ func (e *Paracross) ExecLocal_Commit(payload *pt.ParacrossCommitAction, tx *type
types.Decode(log.Log, &g)
var r pt.ParacrossTx
r.TxHash = string(tx.Hash())
r.TxHash = common.ToHex(tx.Hash())
set.KV = append(set.KV, &types.KeyValue{Key: calcLocalTxKey(g.Status.Title, g.Status.Height, tx.From()), Value: types.Encode(&r)})
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment