Commit graph

16 commits

Author SHA1 Message Date
Anna Shaleva
65503aa9b4 core: add nonce field to transaction
1. Closes #840: added Nonce field to transaction.Transaction and
removed Nonce field from transaction.MinerTx

2. Added following methods to different tx types:
  - NewMinerTx()
  - NewMinerTxWithNonce(...)
  - NewEnrollmentTx(...)
  - NewIssueTx()
  - NewPublishTx(...)
  - NewRegisterTx(...)
  - NewStateTx(...)
in order to avoid code duplication when new transaction is created.

3. Commented out test cases where binary transaction/block are used.
These test cases marked with `TODO NEO3.0: Update binary` and need to be
updated.

4. Updated other tests

5. Added constant Nonce to GoveringTockenTx, UtilityTokenTx and genesis
block to avoid data variability. Also marked with TODO.
2020-04-14 16:19:41 +03:00
Evgenii Stratonikov
9abda40171 testserdes: implement helpers for encode/decode routines
Frequently one needs to check if struct serializes/deserializes
properly. This commit implements helpers for such cases including:
1. JSON
2. io.Serializable interface
2020-03-27 10:27:46 +03:00
Roman Khimov
e41d434a49 *: move all packages from CityOfZion to nspcc-dev 2020-03-03 17:21:42 +03:00
Evgenii Stratonikov
a3dacd3b74 tests: replace t.Fatal with require where possible
This makes tests less verbose and unifies the style
they are written in.
2020-03-02 17:22:27 +03:00
Roman Khimov
b246653f62 address: rename functions as per #579 comments
Make them more clear to understand.
2019-12-25 17:34:18 +03:00
Roman Khimov
e685e9bf9a address: move into its own package
Doesn't really belong to the crypto.
2019-12-25 15:22:02 +03:00
Roman Khimov
f1856bfa8b core/tx: remove publickey indirection from assets and txes
It makes very little sense having pointers here, these structures MUST have
some kind of key and this key is not gonna be wandering somewhere on its
own. Fixes a part of #519.
2019-12-09 18:33:04 +03:00
Evgenii Stratonikov
7179e4ba9f util: add LE suffix to Uint256 methods 2019-12-06 12:16:55 +03:00
Evgenii Stratonikov
57efad912c util: add LE suffix to Uint160 methods 2019-12-06 12:16:55 +03:00
Roman Khimov
d1a4e43c48 io: redo Serializable to return errors in BinReader/BinWriter
Further simplifies error handling.
2019-09-17 13:21:52 +03:00
Roman Khimov
5bf00db2c9 io: move BinReader/BinWriter there, redo Serializable with it
The logic here is that we'll have all binary encoding/decoding done via our io
package, which simplifies error handling. This functionality doesn't belong to
util, so it's moved.

This also expands BufBinWriter with Reset() method to fit the needs of core
package.
2019-09-16 23:39:51 +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
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
Roman Khimov
0cde8d962d fixed8: switch to more uniform function naming 2019-08-26 13:32:19 +03:00
Roman Khimov
d5d570f793 uint256: add Reverse(), change String() to be BE
This one makes a little more obvious that we're operating with LE
representations mostly. Refs. #307. See #314 also.
2019-08-26 13:32:19 +03: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