Commit graph

17 commits

Author SHA1 Message Date
Evgenii Stratonikov
25ffb56982 wallet: support creating multisig accounts
(*Account).ConvertMultisig() will convert an existing account
into a multisig one.
2020-02-21 11:19:35 +03:00
Evgenii Stratonikov
5a727cabf8 wallet: add signature check contracts to new accounts 2020-02-21 10:45:57 +03:00
Evgenii Stratonikov
ad6fa2aea9 wallet: set WIF and public key on account decrypt
They are set during account creation and open+decrypt is
expected to put account in the same state.
2020-02-20 15:52:08 +03:00
Evgenii Stratonikov
d837eb3761 wallet: allow to create accounts from encrypted WIFs 2020-02-20 15:52:08 +03:00
Evgenii Stratonikov
a798e4e0fa wallet: add ScriptHash() method to Contract 2020-01-17 17:25:51 +03:00
Evgenii Stratonikov
a871f75063 wallet: use a script instead a hash
NEO wallets (e.g. used in privnet setup) use hex-encoded
script inside the wallet, not a script hash.
2020-01-17 17:25:51 +03:00
Roman Khimov
9bb68d7025 wallet: make DecryptAccount a method of Account
Otherwise it almost duplicates keys.NEP2Decrypt().
2020-01-09 18:40:30 +03:00
Roman Khimov
b5b05a969c keys: make NEP2Decrypt return a PrivateKey rather than WIF
There is no point in encoding the output of this function in a WIF format,
most of the users actually want the real key and those who need a WIF can
easily get if from the key (and it's simpler than getting the key from the
WIF).

It also fixes a severe bug in NEP2Decrypt, base58 decoding errors were not
processed correctly.
2020-01-09 18:05:14 +03:00
Evgenii Stratonikov
fdd5276d3e network: plug in dBFT library 2019-11-27 10:57:22 +03:00
Vsevolod Brekelov
8ee421db14 fix spelling and godoc comments 2019-10-22 17:56:03 +03:00
Roman Khimov
fabd11699a *: gofmt -s
Appy gofmt for all the source tree.
2019-09-09 12:02:24 +03:00
Roman Khimov
2c3e92923f keys: simplify error handling for PublicKey() and associated
PublicKey() for PrivateKey now just can't fail and it makes no sense to return
an error from it. There is a lot of associated functionality for which this
also is true, so adjust it accordingly and simplify a lot of code.
2019-09-05 12:34:12 +03:00
Roman Khimov
b77e533d13 crypto/wallet: move public/private key into the new keys package
And drop associated _pkg.dev remnants (refs. #307).

Original `dev` branch had two separate packages for public and private keys,
but those are so intertwined (`TestHelper` subpackage is a proof) that it's
better unite them and all associated code (like WIF and NEP-2) in one
package. This patch also:
 * creates internal `keytestcases` package to share things with wallet (maybe
   it'll be changed in some future)
 * ports some tests from `dev`
 * ports Verify() method for public key from `dev`
 * expands TestPrivateKey() with public key check
2019-08-27 17:45:51 +03:00
Anastasia Prasolova
2fd2866f7f Key signature and wallet address get functions added to Public key (#144)
* small fixes

* gofmt

* fix in raw tx build

* fixes after review

* balance getter interface

* moved address and signature calculation to public key

* errors handling

* PublicKey() returns PublicKey instead of bytes slice

* fixes after review

* fixes after review
2019-02-19 18:37:35 +00:00
Evgeniy Kulikov
67cbcac643 Fix typos (#133)
* Fix typos

* revert chains/unit_testnet

* revert chains

* fix review comments (thx @AlexVanin)
2019-02-13 18:01:10 +00:00
Steven Jack
42195b1af4 Refactor peer message sending into single interface method .Send() (#40)
* Adds Send method to Peer interface and removes redundant methods

* Fix imports

* Bumps version
2018-03-04 14:47:56 +01:00
Anthony De Meulemeester
f3f6662fc9
Base wallet implementation (#35)
* Initial draft of the neo-go wallet

* Cleanup + more test for util package

* integrated wallet into neo-cli partially

* base wallet implementation + smartcontract code.
2018-03-02 16:24:09 +01:00