diff --git a/sharding/collation_test.go b/sharding/collation_test.go index 101bf375b..af5779f79 100644 --- a/sharding/collation_test.go +++ b/sharding/collation_test.go @@ -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) + } + */ } diff --git a/sharding/utils/marshal.go b/sharding/utils/marshal.go index 69f1fc01b..a8e098007 100644 --- a/sharding/utils/marshal.go +++ b/sharding/utils/marshal.go @@ -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{} { @@ -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))