@ -1534,15 +1534,15 @@ func TestBlockSizeMarshalTo(t *testing.T) {
}
}
func TestTxSize Proto ( t * testing . T ) {
func TestEvidenceParams Proto ( t * testing . T ) {
seed := time . Now ( ) . UnixNano ( )
popr := math_rand . New ( math_rand . NewSource ( seed ) )
p := NewPopulatedTxSize ( popr , false )
p := NewPopulatedEvidenceParams ( popr , false )
dAtA , err := github_com_gogo_protobuf_proto . Marshal ( p )
if err != nil {
t . Fatalf ( "seed = %d, err = %v" , seed , err )
}
msg := & TxSize { }
msg := & EvidenceParams { }
if err := github_com_gogo_protobuf_proto . Unmarshal ( dAtA , msg ) ; err != nil {
t . Fatalf ( "seed = %d, err = %v" , seed , err )
}
@ -1565,10 +1565,10 @@ func TestTxSizeProto(t *testing.T) {
}
}
func TestTxSize MarshalTo ( t * testing . T ) {
func TestEvidenceParams MarshalTo ( t * testing . T ) {
seed := time . Now ( ) . UnixNano ( )
popr := math_rand . New ( math_rand . NewSource ( seed ) )
p := NewPopulatedTxSize ( popr , false )
p := NewPopulatedEvidenceParams ( popr , false )
size := p . Size ( )
dAtA := make ( [ ] byte , size )
for i := range dAtA {
@ -1578,63 +1578,7 @@ func TestTxSizeMarshalTo(t *testing.T) {
if err != nil {
t . Fatalf ( "seed = %d, err = %v" , seed , err )
}
msg := & TxSize { }
if err := github_com_gogo_protobuf_proto . Unmarshal ( dAtA , msg ) ; err != nil {
t . Fatalf ( "seed = %d, err = %v" , seed , err )
}
for i := range dAtA {
dAtA [ i ] = byte ( popr . Intn ( 256 ) )
}
if ! p . Equal ( msg ) {
t . Fatalf ( "seed = %d, %#v !Proto %#v" , seed , msg , p )
}
}
func TestBlockGossipProto ( t * testing . T ) {
seed := time . Now ( ) . UnixNano ( )
popr := math_rand . New ( math_rand . NewSource ( seed ) )
p := NewPopulatedBlockGossip ( popr , false )
dAtA , err := github_com_gogo_protobuf_proto . Marshal ( p )
if err != nil {
t . Fatalf ( "seed = %d, err = %v" , seed , err )
}
msg := & BlockGossip { }
if err := github_com_gogo_protobuf_proto . Unmarshal ( dAtA , msg ) ; err != nil {
t . Fatalf ( "seed = %d, err = %v" , seed , err )
}
littlefuzz := make ( [ ] byte , len ( dAtA ) )
copy ( littlefuzz , dAtA )
for i := range dAtA {
dAtA [ i ] = byte ( popr . Intn ( 256 ) )
}
if ! p . Equal ( msg ) {
t . Fatalf ( "seed = %d, %#v !Proto %#v" , seed , msg , p )
}
if len ( littlefuzz ) > 0 {
fuzzamount := 100
for i := 0 ; i < fuzzamount ; i ++ {
littlefuzz [ popr . Intn ( len ( littlefuzz ) ) ] = byte ( popr . Intn ( 256 ) )
littlefuzz = append ( littlefuzz , byte ( popr . Intn ( 256 ) ) )
}
// shouldn't panic
_ = github_com_gogo_protobuf_proto . Unmarshal ( littlefuzz , msg )
}
}
func TestBlockGossipMarshalTo ( t * testing . T ) {
seed := time . Now ( ) . UnixNano ( )
popr := math_rand . New ( math_rand . NewSource ( seed ) )
p := NewPopulatedBlockGossip ( popr , false )
size := p . Size ( )
dAtA := make ( [ ] byte , size )
for i := range dAtA {
dAtA [ i ] = byte ( popr . Intn ( 256 ) )
}
_ , err := p . MarshalTo ( dAtA )
if err != nil {
t . Fatalf ( "seed = %d, err = %v" , seed , err )
}
msg := & BlockGossip { }
msg := & EvidenceParams { }
if err := github_com_gogo_protobuf_proto . Unmarshal ( dAtA , msg ) ; err != nil {
t . Fatalf ( "seed = %d, err = %v" , seed , err )
}
@ -2636,34 +2580,16 @@ func TestBlockSizeJSON(t *testing.T) {
t . Fatalf ( "seed = %d, %#v !Json Equal %#v" , seed , msg , p )
}
}
func TestTxSize JSON ( t * testing . T ) {
func TestEvidenceParams JSON ( t * testing . T ) {
seed := time . Now ( ) . UnixNano ( )
popr := math_rand . New ( math_rand . NewSource ( seed ) )
p := NewPopulatedTxSize ( popr , true )
p := NewPopulatedEvidenceParams ( popr , true )
marshaler := github_com_gogo_protobuf_jsonpb . Marshaler { }
jsondata , err := marshaler . MarshalToString ( p )
if err != nil {
t . Fatalf ( "seed = %d, err = %v" , seed , err )
}
msg := & TxSize { }
err = github_com_gogo_protobuf_jsonpb . UnmarshalString ( jsondata , msg )
if err != nil {
t . Fatalf ( "seed = %d, err = %v" , seed , err )
}
if ! p . Equal ( msg ) {
t . Fatalf ( "seed = %d, %#v !Json Equal %#v" , seed , msg , p )
}
}
func TestBlockGossipJSON ( t * testing . T ) {
seed := time . Now ( ) . UnixNano ( )
popr := math_rand . New ( math_rand . NewSource ( seed ) )
p := NewPopulatedBlockGossip ( popr , true )
marshaler := github_com_gogo_protobuf_jsonpb . Marshaler { }
jsondata , err := marshaler . MarshalToString ( p )
if err != nil {
t . Fatalf ( "seed = %d, err = %v" , seed , err )
}
msg := & BlockGossip { }
msg := & EvidenceParams { }
err = github_com_gogo_protobuf_jsonpb . UnmarshalString ( jsondata , msg )
if err != nil {
t . Fatalf ( "seed = %d, err = %v" , seed , err )
@ -3590,12 +3516,12 @@ func TestBlockSizeProtoCompactText(t *testing.T) {
}
}
func TestTxSize ProtoText ( t * testing . T ) {
func TestEvidenceParams ProtoText ( t * testing . T ) {
seed := time . Now ( ) . UnixNano ( )
popr := math_rand . New ( math_rand . NewSource ( seed ) )
p := NewPopulatedTxSize ( popr , true )
p := NewPopulatedEvidenceParams ( popr , true )
dAtA := github_com_gogo_protobuf_proto . MarshalTextString ( p )
msg := & TxSize { }
msg := & EvidenceParams { }
if err := github_com_gogo_protobuf_proto . UnmarshalText ( dAtA , msg ) ; err != nil {
t . Fatalf ( "seed = %d, err = %v" , seed , err )
}
@ -3604,40 +3530,12 @@ func TestTxSizeProtoText(t *testing.T) {
}
}
func TestTxSize ProtoCompactText ( t * testing . T ) {
func TestEvidenceParams ProtoCompactText ( t * testing . T ) {
seed := time . Now ( ) . UnixNano ( )
popr := math_rand . New ( math_rand . NewSource ( seed ) )
p := NewPopulatedTxSize ( popr , true )
p := NewPopulatedEvidenceParams ( popr , true )
dAtA := github_com_gogo_protobuf_proto . CompactTextString ( p )
msg := & TxSize { }
if err := github_com_gogo_protobuf_proto . UnmarshalText ( dAtA , msg ) ; err != nil {
t . Fatalf ( "seed = %d, err = %v" , seed , err )
}
if ! p . Equal ( msg ) {
t . Fatalf ( "seed = %d, %#v !Proto %#v" , seed , msg , p )
}
}
func TestBlockGossipProtoText ( t * testing . T ) {
seed := time . Now ( ) . UnixNano ( )
popr := math_rand . New ( math_rand . NewSource ( seed ) )
p := NewPopulatedBlockGossip ( popr , true )
dAtA := github_com_gogo_protobuf_proto . MarshalTextString ( p )
msg := & BlockGossip { }
if err := github_com_gogo_protobuf_proto . UnmarshalText ( dAtA , msg ) ; err != nil {
t . Fatalf ( "seed = %d, err = %v" , seed , err )
}
if ! p . Equal ( msg ) {
t . Fatalf ( "seed = %d, %#v !Proto %#v" , seed , msg , p )
}
}
func TestBlockGossipProtoCompactText ( t * testing . T ) {
seed := time . Now ( ) . UnixNano ( )
popr := math_rand . New ( math_rand . NewSource ( seed ) )
p := NewPopulatedBlockGossip ( popr , true )
dAtA := github_com_gogo_protobuf_proto . CompactTextString ( p )
msg := & BlockGossip { }
msg := & EvidenceParams { }
if err := github_com_gogo_protobuf_proto . UnmarshalText ( dAtA , msg ) ; err != nil {
t . Fatalf ( "seed = %d, err = %v" , seed , err )
}
@ -4492,32 +4390,10 @@ func TestBlockSizeSize(t *testing.T) {
}
}
func TestTxSizeSize ( t * testing . T ) {
seed := time . Now ( ) . UnixNano ( )
popr := math_rand . New ( math_rand . NewSource ( seed ) )
p := NewPopulatedTxSize ( popr , true )
size2 := github_com_gogo_protobuf_proto . Size ( p )
dAtA , err := github_com_gogo_protobuf_proto . Marshal ( p )
if err != nil {
t . Fatalf ( "seed = %d, err = %v" , seed , err )
}
size := p . Size ( )
if len ( dAtA ) != size {
t . Errorf ( "seed = %d, size %v != marshalled size %v" , seed , size , len ( dAtA ) )
}
if size2 != size {
t . Errorf ( "seed = %d, size %v != before marshal proto.Size %v" , seed , size , size2 )
}
size3 := github_com_gogo_protobuf_proto . Size ( p )
if size3 != size {
t . Errorf ( "seed = %d, size %v != after marshal proto.Size %v" , seed , size , size3 )
}
}
func TestBlockGossipSize ( t * testing . T ) {
func TestEvidenceParamsSize ( t * testing . T ) {
seed := time . Now ( ) . UnixNano ( )
popr := math_rand . New ( math_rand . NewSource ( seed ) )
p := NewPopulatedBlockGossip ( popr , true )
p := NewPopulatedEvidenceParams ( popr , true )
size2 := github_com_gogo_protobuf_proto . Size ( p )
dAtA , err := github_com_gogo_protobuf_proto . Marshal ( p )
if err != nil {