keystoreGetKey gets the key info from the keystore using raw JSON
(rpcURL, address, password string)
| 217 | |
| 218 | // keystoreGetKey gets the key info from the keystore using raw JSON |
| 219 | func keystoreGetKey(rpcURL, address, password string) (*keyGroup, error) { |
| 220 | reqJSON := fmt.Sprintf(`{"address":"%s","password":"%s"}`, address, password) |
| 221 | |
| 222 | respBody, err := postRawJSON(rpcURL+"/v1/admin/keystore-get", reqJSON) |
| 223 | if err != nil { |
| 224 | return nil, err |
| 225 | } |
| 226 | |
| 227 | var kg keyGroup |
| 228 | if err := json.Unmarshal(respBody, &kg); err != nil { |
| 229 | return nil, fmt.Errorf("failed to parse response: %v, body: %s", err, string(respBody)) |
| 230 | } |
| 231 | |
| 232 | return &kg, nil |
| 233 | } |
| 234 | |
| 235 | // getHeight gets the current blockchain height using raw JSON |
| 236 | func getHeight(rpcURL string) (uint64, error) { |
no test coverage detected