Skip to content
Snippets Groups Projects
Commit ac434d55 authored by Hans Moog's avatar Hans Moog
Browse files

Fix: fixed missing iota.go merges

parent 06805040
Branches
Tags
No related merge requests found
...@@ -27,8 +27,8 @@ func NewBatchHasher(hashLength int, rounds int) (result *BatchHasher) { ...@@ -27,8 +27,8 @@ func NewBatchHasher(hashLength int, rounds int) (result *BatchHasher) {
return return
} }
func (this *BatchHasher) Hash(trits ternary.Trits) ternary.Trits { func (this *BatchHasher) Hash(trits trinary.Trits) trinary.Trits {
return (<-this.workerPool.Submit(trits)).(ternary.Trits) return (<-this.workerPool.Submit(trits)).(trinary.Trits)
} }
func (this *BatchHasher) processHashes(tasks []batchworkerpool.Task) { func (this *BatchHasher) processHashes(tasks []batchworkerpool.Task) {
...@@ -36,7 +36,7 @@ func (this *BatchHasher) processHashes(tasks []batchworkerpool.Task) { ...@@ -36,7 +36,7 @@ func (this *BatchHasher) processHashes(tasks []batchworkerpool.Task) {
// multiplex the requests // multiplex the requests
multiplexer := ternary.NewBCTernaryMultiplexer() multiplexer := ternary.NewBCTernaryMultiplexer()
for _, hashRequest := range tasks { for _, hashRequest := range tasks {
multiplexer.Add(hashRequest.Param(0).(ternary.Trits)) multiplexer.Add(hashRequest.Param(0).(trinary.Trits))
} }
bcTrits, err := multiplexer.Extract() bcTrits, err := multiplexer.Extract()
if err != nil { if err != nil {
...@@ -56,7 +56,7 @@ func (this *BatchHasher) processHashes(tasks []batchworkerpool.Task) { ...@@ -56,7 +56,7 @@ func (this *BatchHasher) processHashes(tasks []batchworkerpool.Task) {
} else { } else {
var resp = make(trinary.Trits, this.hashLength) var resp = make(trinary.Trits, this.hashLength)
trits := tasks[0].Param(0).(ternary.Trits) trits := tasks[0].Param(0).(trinary.Trits)
curl := NewCurl(this.hashLength, this.rounds) curl := NewCurl(this.hashLength, this.rounds)
curl.Absorb(trits, 0, len(trits)) curl.Absorb(trits, 0, len(trits))
......
...@@ -5,13 +5,13 @@ import ( ...@@ -5,13 +5,13 @@ import (
"github.com/iotaledger/goshimmer/packages/model/bundle" "github.com/iotaledger/goshimmer/packages/model/bundle"
"github.com/iotaledger/goshimmer/packages/model/transactionmetadata" "github.com/iotaledger/goshimmer/packages/model/transactionmetadata"
"github.com/iotaledger/goshimmer/packages/model/value_transaction" "github.com/iotaledger/goshimmer/packages/model/value_transaction"
"github.com/iotaledger/goshimmer/packages/ternary"
"github.com/iotaledger/goshimmer/plugins/tangle" "github.com/iotaledger/goshimmer/plugins/tangle"
"github.com/iotaledger/iota.go/trinary"
) )
func ProcessSolidBundleHead(headTransaction *value_transaction.ValueTransaction) (*bundle.Bundle, errors.IdentifiableError) { func ProcessSolidBundleHead(headTransaction *value_transaction.ValueTransaction) (*bundle.Bundle, errors.IdentifiableError) {
// only process the bundle if we didn't process it, yet // only process the bundle if we didn't process it, yet
return tangle.GetBundle(headTransaction.GetHash(), func(headTransactionHash ternary.Trytes) (*bundle.Bundle, errors.IdentifiableError) { return tangle.GetBundle(headTransaction.GetHash(), func(headTransactionHash trinary.Trytes) (*bundle.Bundle, errors.IdentifiableError) {
// abort if bundle syntax is wrong // abort if bundle syntax is wrong
if !headTransaction.IsHead() { if !headTransaction.IsHead() {
return nil, ErrProcessBundleFailed.Derive(errors.New("invalid parameter"), "transaction needs to be head of bundle") return nil, ErrProcessBundleFailed.Derive(errors.New("invalid parameter"), "transaction needs to be head of bundle")
...@@ -67,8 +67,8 @@ func ProcessSolidBundleHead(headTransaction *value_transaction.ValueTransaction) ...@@ -67,8 +67,8 @@ func ProcessSolidBundleHead(headTransaction *value_transaction.ValueTransaction)
}) })
} }
func mapTransactionsToTransactionHashes(transactions []*value_transaction.ValueTransaction) (result []ternary.Trytes) { func mapTransactionsToTransactionHashes(transactions []*value_transaction.ValueTransaction) (result []trinary.Trytes) {
result = make([]ternary.Trytes, len(transactions)) result = make([]trinary.Trytes, len(transactions))
for k, v := range transactions { for k, v := range transactions {
result[k] = v.GetHash() result[k] = v.GetHash()
} }
......
...@@ -7,7 +7,6 @@ import ( ...@@ -7,7 +7,6 @@ import (
"github.com/iotaledger/goshimmer/packages/node" "github.com/iotaledger/goshimmer/packages/node"
"github.com/iotaledger/goshimmer/packages/workerpool" "github.com/iotaledger/goshimmer/packages/workerpool"
"github.com/iotaledger/goshimmer/plugins/tangle" "github.com/iotaledger/goshimmer/plugins/tangle"
"github.com/iotaledger/iota.go/trinary"
) )
var PLUGIN = node.NewPlugin("Bundle Processor", configure, run) var PLUGIN = node.NewPlugin("Bundle Processor", configure, run)
......
...@@ -9,7 +9,6 @@ import ( ...@@ -9,7 +9,6 @@ import (
"github.com/iotaledger/goshimmer/packages/model/transactionmetadata" "github.com/iotaledger/goshimmer/packages/model/transactionmetadata"
"github.com/iotaledger/goshimmer/packages/model/value_transaction" "github.com/iotaledger/goshimmer/packages/model/value_transaction"
"github.com/iotaledger/goshimmer/packages/node" "github.com/iotaledger/goshimmer/packages/node"
"github.com/iotaledger/goshimmer/packages/ternary"
"github.com/iotaledger/goshimmer/packages/workerpool" "github.com/iotaledger/goshimmer/packages/workerpool"
"github.com/iotaledger/goshimmer/plugins/gossip" "github.com/iotaledger/goshimmer/plugins/gossip"
"github.com/iotaledger/iota.go/trinary" "github.com/iotaledger/iota.go/trinary"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment