mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-23 12:07:17 +00:00
24 lines
481 B
Go
24 lines
481 B
Go
package rpc
|
|
|
|
import (
|
|
"encoding/json"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestAllowListMarshaling(t *testing.T) {
|
|
|
|
}
|
|
|
|
func TestAllowListUnmarshaling(t *testing.T) {
|
|
allowListJSON := `[ "one", "two", "three" ]`
|
|
|
|
var allowList AllowList
|
|
err := json.Unmarshal([]byte(allowListJSON), &allowList)
|
|
assert.NoError(t, err, "should unmarshal successfully")
|
|
|
|
m := map[string]struct{}{"one": {}, "two": {}, "three": {}}
|
|
assert.Equal(t, allowList, AllowList(m))
|
|
}
|