sharding: Cleaning up tests (#92)

Former-commit-id: 143739c759abdd01fb74539a85c5cd4abf5d1b79 [formerly d375cec6b8bfb6c08946e6bad5d423a02e554333]
Former-commit-id: 302a456f3e6045605fa32790933f999844793d68
This commit is contained in:
nisdas 2018-05-08 17:12:11 +08:00
parent cdf89d07ae
commit 3749175c31
2 changed files with 11 additions and 11 deletions

View File

@ -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)
}
*/
}

View File

@ -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))