Commit graph

7 commits

Author SHA1 Message Date
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
Roman Khimov
ec7e17ffa6 pkg: make use of the new crypto/hash package
Simplifies a lot of code and removes some duplication. Unfortunately I had to
move test_util random functions in same commit to avoid cycle
dependencies. One of these random functions was also used in core/transaction
testing, to simplify things I've just dropped it there and used a static
string (which is nice to have for a test anyway).

There is still sha256 left in wallet (but it needs to pass Hash structure into
the signing function).
2019-08-26 13:32:19 +03:00
Anastasia Prasolova
a56511ced3 PublicKey from serialized bytes (#154)
* 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

* public key creation from asn1 serialized key
2019-02-20 14:34:28 +01: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
9252937375 Simplify code and improve performance (crypto/PublicKey.DecodeBinary) (#121)
- optimize crypto/PublicKey.DecodeBinary
- add new method crypto/PublicKey.DecodeBytes
2019-01-28 13:03:02 +01:00
Anthony De Meulemeester
94672cb9cc
Persistance (#53)
* added publish TX for backwards compat.

* lowered the prototick for faster block syncing

* print useragent on startup

* added createMultiRedeemScript for genesis block generation.

* building genesis block from scratch.

* implemented merkle tree.

* starting blockhain with generated genesis hash

* Fixed bug in unspent coin state.

* fixed broken tests after genesis block.

* removed log line.

* bumped version -> 0.34.0
2018-03-25 12:45:54 +02:00
Anthony De Meulemeester
52fa41a12a
Persist transactions (#51)
* added account_state + changed ECPoint to PublicKey

* account state persist

* in depth test for existing accounts.

* implemented GetTransaction.

* added enrollment TX

* added persist of accounts and unspent coins

* bumped version -> 0.32.0
2018-03-21 17:11:04 +01:00