use Encoder/Decoder in types/encoding.go

parent 0cb81ce7
......@@ -8,6 +8,7 @@ import (
"github.com/NebulousLabs/Sia/build"
"github.com/NebulousLabs/Sia/crypto"
"github.com/NebulousLabs/Sia/encoding"
)
const (
......@@ -118,7 +119,7 @@ func (b Block) ID() BlockID {
func (b Block) MerkleRoot() crypto.Hash {
tree := crypto.NewTree()
var buf bytes.Buffer
e := encoder(&buf)
e := encoding.NewEncoder(&buf)
for _, payout := range b.MinerPayouts {
payout.MarshalSia(e)
tree.Push(buf.Bytes())
......
This diff is collapsed.
......@@ -163,7 +163,7 @@ func Ed25519PublicKey(pk crypto.PublicKey) SiaPublicKey {
// protected by having random public keys next to them.
func (uc UnlockConditions) UnlockHash() UnlockHash {
var buf bytes.Buffer
e := encoder(&buf)
e := encoding.NewEncoder(&buf)
tree := crypto.NewTree()
e.WriteUint64(uint64(uc.Timelock))
tree.Push(buf.Bytes())
......
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