mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-05 09:14:28 +00:00
sharding: Cleaning up tests (#92)
Former-commit-id: 143739c759abdd01fb74539a85c5cd4abf5d1b79 [formerly d375cec6b8bfb6c08946e6bad5d423a02e554333] Former-commit-id: 302a456f3e6045605fa32790933f999844793d68
This commit is contained in:
parent
cdf89d07ae
commit
3749175c31
@ -90,11 +90,15 @@ func TestSerialize(t *testing.T) {
|
|||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
c := &Collation{}
|
c := &Collation{}
|
||||||
|
for _, tx := range tt.transactions {
|
||||||
results, err := c.Serialize()
|
c.AddTransaction(tx)
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("%v --- %v ----%v", err, tt, results)
|
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
results, err := c.Serialize()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("%v ----%v---%v", err, results, c.transactions)
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,16 +17,12 @@ func ConvertInterface(arg interface{}, kind reflect.Kind) ([]interface{}, error)
|
|||||||
val := reflect.ValueOf(arg)
|
val := reflect.ValueOf(arg)
|
||||||
if val.Kind() == kind {
|
if val.Kind() == kind {
|
||||||
|
|
||||||
newtype := make([]interface{}, val.Len())
|
return val.Interface().([]interface{}), nil
|
||||||
for i := 1; i < val.Len(); i++ {
|
|
||||||
newtype[i] = val.Index(i)
|
|
||||||
}
|
|
||||||
|
|
||||||
return newtype, nil
|
|
||||||
|
|
||||||
}
|
}
|
||||||
err := errors.New("Interface Conversion a failure")
|
err := errors.New("Interface Conversion a failure")
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func convertbyteToInterface(arg []byte) []interface{} {
|
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) {
|
func Serialize(rawtx []interface{}) ([]byte, error) {
|
||||||
length := int64(len(rawtx))
|
length := int64(len(rawtx))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user