aboutsummaryrefslogtreecommitdiffstats
path: root/signer/storage
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2019-03-07 17:56:08 +0800
committerPéter Szilágyi <peterke@gmail.com>2019-03-07 17:56:08 +0800
commit5f94f8c7e7cfc6d037accfad379ce2ab0df6bf47 (patch)
treeac9db4d11def29b0c7fbd638567e05797d929678 /signer/storage
parenteb199f1fc2fc91e40431c5acce61227a95d476bb (diff)
downloadgo-tangerine-5f94f8c7e7cfc6d037accfad379ce2ab0df6bf47.tar
go-tangerine-5f94f8c7e7cfc6d037accfad379ce2ab0df6bf47.tar.gz
go-tangerine-5f94f8c7e7cfc6d037accfad379ce2ab0df6bf47.tar.bz2
go-tangerine-5f94f8c7e7cfc6d037accfad379ce2ab0df6bf47.tar.lz
go-tangerine-5f94f8c7e7cfc6d037accfad379ce2ab0df6bf47.tar.xz
go-tangerine-5f94f8c7e7cfc6d037accfad379ce2ab0df6bf47.tar.zst
go-tangerine-5f94f8c7e7cfc6d037accfad379ce2ab0df6bf47.zip
signer: change the stdio jsonrpc to use legacy namespace conventions (#19047)
This PR will will break existing UIs, since it changes all calls like ApproveSignTransaction to be on the form ui_approveSignTransaction. This is to make it possible for the UI to reuse the json-rpc library from go-ethereum, which uses this convention. Also, this PR removes some unused structs, after import/export were removed from the external api (so no longer needs internal methods for approval) One more breaking change is introduced, removing passwords from the ApproveSignTxResponse and the likes. This makes the manual interface more like the rulebased interface, and integrates nicely with the credential storage. Thus, the way it worked before, it would be tempting for the UI to implement 'remember password' functionality. The way it is now, it will be easy instead to tell clef to store passwords and use them. If a pw is not found in the credential store, the user is prompted to provide the password.
Diffstat (limited to 'signer/storage')
-rw-r--r--signer/storage/storage.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/signer/storage/storage.go b/signer/storage/storage.go
index 60f4e3892..50c55e455 100644
--- a/signer/storage/storage.go
+++ b/signer/storage/storage.go
@@ -17,10 +17,6 @@
package storage
-import (
- "fmt"
-)
-
type Storage interface {
// Put stores a value by key. 0-length keys results in no-op
Put(key, value string)
@@ -39,7 +35,7 @@ func (s *EphemeralStorage) Put(key, value string) {
if len(key) == 0 {
return
}
- fmt.Printf("storage: put %v -> %v\n", key, value)
+ //fmt.Printf("storage: put %v -> %v\n", key, value)
s.data[key] = value
}
@@ -47,7 +43,7 @@ func (s *EphemeralStorage) Get(key string) string {
if len(key) == 0 {
return ""
}
- fmt.Printf("storage: get %v\n", key)
+ //fmt.Printf("storage: get %v\n", key)
if v, exist := s.data[key]; exist {
return v
}
@@ -60,3 +56,11 @@ func NewEphemeralStorage() Storage {
}
return s
}
+
+// NoStorage is a dummy construct which doesn't remember anything you tell it
+type NoStorage struct{}
+
+func (s *NoStorage) Put(key, value string) {}
+func (s *NoStorage) Get(key string) string {
+ return ""
+}