feat: receive wallet events and bump nim-status

This commit is contained in:
Richard Ramos 2020-09-03 11:11:13 -04:00 committed by Iuri Matias
parent 4f409f76c8
commit 374da83cff
5 changed files with 14 additions and 10 deletions

View File

@ -26,6 +26,7 @@ proc delete*(self: WalletController) =
delete self.view
proc init*(self: WalletController) =
status_wallet.startWallet()
self.status.wallet.initAccounts()
var accounts = self.status.wallet.accounts
for account in accounts:

View File

@ -1,6 +1,7 @@
import json, os, nimcrypto, uuids, json_serialization, chronicles, strutils
import nim_status, core
from nim_status import multiAccountGenerateAndDeriveAddresses, generateAlias, identicon, saveAccountAndLogin, login, openAccounts
import core
import utils as utils
import types as types
import accounts/constants
@ -42,10 +43,10 @@ proc generateAddresses*(n = 5): seq[GeneratedAccount] =
result = Json.decode(generatedAccounts, seq[GeneratedAccount])
proc generateAlias*(publicKey: string): string =
result = $nim_status.generateAlias(publicKey.cstring)
result = $nim_status.generateAlias(publicKey)
proc generateIdenticon*(publicKey: string): string =
result = $nim_status.identicon(publicKey.cstring)
result = $nim_status.identicon(publicKey)
proc ensureDir(dirname: string) =
if not existsDir(dirname):

View File

@ -19,9 +19,6 @@ proc keys*(obj: JsonNode): seq[string] =
for k, _ in obj:
result.add k
proc toGoString*(str: string): GoString =
result = GoString(str: str, length: cint(str.len))
proc generateSigningPhrase*(count: int): string =
let now = getTime()
var rng = initRand(now.toUnix * 1000000000 + now.nanosecond)

View File

@ -1,6 +1,6 @@
import json, options
import stint, chronicles, json_serialization
import nim_status, core, types, utils
import json, options, httpclient, json, json_serialization, strformat, stint, strutils, sequtils, chronicles, parseutils, tables
import core, types, utils
from nim_status import validateMnemonic, startWallet
import ../wallet/account
import ./contracts as contractMethods
import eth/common/eth_types
@ -88,3 +88,8 @@ proc hex2Eth*(input: string): string =
proc validateMnemonic*(mnemonic: string): string =
result = $nim_status.validateMnemonic(mnemonic)
proc startWallet*() =
discard nim_status.startWallet()

2
vendor/nim-status vendored

@ -1 +1 @@
Subproject commit b3e3a8920b79a5a75c6680730c7f75e6201afde7
Subproject commit 46c93dd7346c8e6f8778dbc92ab5cee2e4930e60