mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-03 08:37:37 +00:00
sharding: address linter errors
Former-commit-id: 70fee9bf5816e9520fb927b84ab8b93d83014869 [formerly 523192e37e40878079d7981bd28ed25f618ab0a6] Former-commit-id: 604f33826c63ff42dd90d75bb517ed09f5d52b6a
This commit is contained in:
parent
fc1fb315bc
commit
dfaf005229
@ -27,10 +27,10 @@ var (
|
||||
notaryDepositInsufficient, _ = new(big.Int).SetString("999000000000000000000", 10)
|
||||
notaryDeposit, _ = new(big.Int).SetString("1000000000000000000000", 10)
|
||||
FastForward100Blocks = 100
|
||||
smcConfig = SMCConfig{
|
||||
notaryLockupLenght: new(big.Int).SetInt64(1),
|
||||
proposerLockupLength: new(big.Int).SetInt64(1),
|
||||
}
|
||||
// smcConfig = SMCConfig{
|
||||
// notaryLockupLenght: new(big.Int).SetInt64(1),
|
||||
// proposerLockupLength: new(big.Int).SetInt64(1),
|
||||
// }
|
||||
ctx = context.Background()
|
||||
)
|
||||
|
||||
|
@ -12,7 +12,7 @@ var _ = sharding.ShardBackend(&ShardKV{})
|
||||
|
||||
func Test_ShardKVPut(t *testing.T) {
|
||||
kv := NewShardKV()
|
||||
hash := common.StringToHash("ralph merkle")
|
||||
hash := common.BytesToHash([]byte("ralph merkle"))
|
||||
|
||||
if err := kv.Put(hash, []byte{1, 2, 3}); err != nil {
|
||||
t.Errorf("could not save value in kv store: %v", err)
|
||||
@ -21,7 +21,7 @@ func Test_ShardKVPut(t *testing.T) {
|
||||
|
||||
func Test_ShardKVHas(t *testing.T) {
|
||||
kv := NewShardKV()
|
||||
hash := common.StringToHash("ralph merkle")
|
||||
hash := common.BytesToHash([]byte("ralph merkle"))
|
||||
|
||||
if err := kv.Put(hash, []byte{1, 2, 3}); err != nil {
|
||||
t.Fatalf("could not save value in kv store: %v", err)
|
||||
@ -31,7 +31,7 @@ func Test_ShardKVHas(t *testing.T) {
|
||||
t.Errorf("kv store does not have hash: %v", hash)
|
||||
}
|
||||
|
||||
hash2 := common.StringToHash("")
|
||||
hash2 := common.BytesToHash([]byte{})
|
||||
if kv.Has(hash2) {
|
||||
t.Errorf("kv store should not contain unset key: %v", hash2)
|
||||
}
|
||||
@ -39,7 +39,7 @@ func Test_ShardKVHas(t *testing.T) {
|
||||
|
||||
func Test_ShardKVGet(t *testing.T) {
|
||||
kv := NewShardKV()
|
||||
hash := common.StringToHash("ralph merkle")
|
||||
hash := common.BytesToHash([]byte("ralph merkle"))
|
||||
|
||||
if err := kv.Put(hash, []byte{1, 2, 3}); err != nil {
|
||||
t.Fatalf("could not save value in kv store: %v", err)
|
||||
@ -53,7 +53,7 @@ func Test_ShardKVGet(t *testing.T) {
|
||||
t.Errorf("no value stored for key")
|
||||
}
|
||||
|
||||
hash2 := common.StringToHash("")
|
||||
hash2 := common.BytesToHash([]byte{})
|
||||
val2, err := kv.Get(hash2)
|
||||
if val2 != nil {
|
||||
t.Errorf("non-existent key should not have a value. key=%v, value=%v", hash2, val2)
|
||||
@ -62,7 +62,7 @@ func Test_ShardKVGet(t *testing.T) {
|
||||
|
||||
func Test_ShardKVDelete(t *testing.T) {
|
||||
kv := NewShardKV()
|
||||
hash := common.StringToHash("ralph merkle")
|
||||
hash := common.BytesToHash([]byte("ralph merkle"))
|
||||
|
||||
if err := kv.Put(hash, []byte{1, 2, 3}); err != nil {
|
||||
t.Fatalf("could not save value in kv store: %v", err)
|
||||
|
Loading…
Reference in New Issue
Block a user