mirror of
https://github.com/status-im/status-go.git
synced 2026-08-31 09:01:16 +00:00
Part of the Go project layout migration, item 31. Pure move plus import-path rewrite across 687 files. No API or behaviour change. The services keep their grouping under pkg/services/<name> rather than being promoted to pkg/<name>: 27 top-level directories in pkg/ would read worse than what we have, and the grouping is what makes "an RPC service" identifiable at a glance. Paths that follow the move: the logosstorage test target and generate step, the two wallet token-list tools, the migration-order check (and the pre-rebase hook symlinked to it), and the storage env helper. refs #7067
31 lines
775 B
Go
31 lines
775 B
Go
package wallet_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/status-im/status-go/pkg/services/wallet"
|
|
)
|
|
|
|
// TestAPI_HashMessageEIP191
|
|
func TestAPI_HashMessageEIP191(t *testing.T) {
|
|
api := &wallet.API{}
|
|
|
|
res := api.HashMessageEIP191(context.Background(), []byte("test"))
|
|
require.Equal(t, "0x4a5c5d454721bbbb25540c3317521e71c373ae36458f960d2ad46ef088110e95", res.String())
|
|
}
|
|
|
|
func TestAPI_IsChecksumValidForAddress(t *testing.T) {
|
|
api := &wallet.API{}
|
|
|
|
res, err := api.IsChecksumValidForAddress("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
|
|
require.NoError(t, err)
|
|
require.False(t, res)
|
|
|
|
res, err = api.IsChecksumValidForAddress("0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa")
|
|
require.NoError(t, err)
|
|
require.True(t, res)
|
|
}
|