rpc: personal_initializeWallet (#740)

* Problem: need to add JSON-RPC endpoint personal_initializeWallet

Closes #738

* this is aimed at smartcard wallet which is not supported yet.

* changelog and not skip for expecting error

* fix personal_test error message assertion

* Apply suggestions from code review

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
Adu
2021-11-11 15:12:14 +00:00
committed by GitHub
co-authored by Federico Kunze Küllmer
parent a3f1d8d89d
commit a874c1e1ca
3 changed files with 15 additions and 8 deletions
+6 -8
View File
@@ -2,8 +2,6 @@ package rpc
import (
"encoding/json"
"errors"
"fmt"
"testing"
"github.com/stretchr/testify/require"
@@ -146,11 +144,11 @@ func TestPersonal_LockAccount(t *testing.T) {
}
func TestPersonal_Unpair(t *testing.T) {
t.Skip("skipping TestPersonal_Unpair")
_, err := CallWithError("personal_unpair", []interface{}{"", ""})
require.Equal(t, "smartcard wallet not supported yet", err.Error())
}
rpcRes := Call(t, "personal_unpair", []interface{}{"", 0})
var res error
err := json.Unmarshal(rpcRes.Result, &res)
require.True(t, errors.Is(err, fmt.Errorf("smartcard wallet not supported yet")))
func TestPersonal_InitializeWallet(t *testing.T) {
_, err := CallWithError("personal_initializeWallet", []interface{}{""})
require.Equal(t, "smartcard wallet not supported yet", err.Error())
}