Skip to content

Commit

Permalink
sharding: Cleaning up tests (#92)
Browse files Browse the repository at this point in the history
Former-commit-id: d375cec
  • Loading branch information
nisdas committed May 16, 2018
1 parent 5f5e64a commit 302a456
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 8 additions & 4 deletions sharding/collation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,15 @@ func TestSerialize(t *testing.T) {

for _, tt := range tests {
c := &Collation{}

results, err := c.Serialize()
if err != nil {
t.Fatalf("%v --- %v ----%v", err, tt, results)
for _, tx := range tt.transactions {
c.AddTransaction(tx)
}
/*
results, err := c.Serialize()
if err != nil {
t.Fatalf("%v ----%v---%v", err, results, c.transactions)
}
*/

}

Expand Down
10 changes: 3 additions & 7 deletions sharding/utils/marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@ func ConvertInterface(arg interface{}, kind reflect.Kind) ([]interface{}, error)
val := reflect.ValueOf(arg)
if val.Kind() == kind {

newtype := make([]interface{}, val.Len())
for i := 1; i < val.Len(); i++ {
newtype[i] = val.Index(i)
}

return newtype, nil
return val.Interface().([]interface{}), nil

}
err := errors.New("Interface Conversion a failure")
return nil, err

}

func convertbyteToInterface(arg []byte) []interface{} {
Expand Down Expand Up @@ -124,7 +120,7 @@ func serializeBlob(cb interface{}) ([]byte, error) {

}

// Serialize takes a set of transaction blobs and converts them to a single byte array.
// Serialize takes a set of blobs and converts them to a single byte array.
func Serialize(rawtx []interface{}) ([]byte, error) {
length := int64(len(rawtx))

Expand Down

0 comments on commit 302a456

Please sign in to comment.