@@ -10,6 +10,7 @@ import (
10
10
11
11
"github.com/golang/mock/gomock"
12
12
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
13
+ "github.com/prysmaticlabs/prysm/shared/bytesutil"
13
14
"github.com/prysmaticlabs/prysm/shared/mock"
14
15
"github.com/prysmaticlabs/prysm/shared/testutil/assert"
15
16
"github.com/prysmaticlabs/prysm/shared/testutil/require"
@@ -266,3 +267,15 @@ func TestDisplayExitInfo_NoKeys(t *testing.T) {
266
267
displayExitInfo ([][]byte {}, []string {})
267
268
assert .LogsContain (t , logHook , "No successful voluntary exits" )
268
269
}
270
+
271
+ func TestPrepareAllKeys (t * testing.T ) {
272
+ key1 := bytesutil .ToBytes48 ([]byte ("key1" ))
273
+ key2 := bytesutil .ToBytes48 ([]byte ("key2" ))
274
+ raw , formatted := prepareAllKeys ([][48 ]byte {key1 , key2 })
275
+ require .Equal (t , 2 , len (raw ))
276
+ require .Equal (t , 2 , len (formatted ))
277
+ assert .DeepEqual (t , bytesutil .ToBytes48 ([]byte {107 , 101 , 121 , 49 }), bytesutil .ToBytes48 (raw [0 ]))
278
+ assert .DeepEqual (t , bytesutil .ToBytes48 ([]byte {107 , 101 , 121 , 50 }), bytesutil .ToBytes48 (raw [1 ]))
279
+ assert .Equal (t , "0x6b6579310000" , formatted [0 ])
280
+ assert .Equal (t , "0x6b6579320000" , formatted [1 ])
281
+ }
0 commit comments