16 Commits

Author SHA1 Message Date
Ori Newman
254eab96cd [NOD-55] Change daghash hash to pointer in most places (#239)
* [NOD-55] Change daghash.Hash to pointer in most places

* [NOD-55] Fixed format error

* [NOD-55] Fixed merge error

* [NOD-55] Cancel copying hash in blockSet.hashes()
2019-04-02 13:49:47 +03:00
Evgeny Khirin
b4f50f4e48 [Nod-25] Add payload hash to wire transaction (#200)
* [NOD-25] Intermediate commit

* [NOD-25] Fixed tests crashes

* [NOD-25] Fixed tests

* [NOD-25] Removed temporary debug code

* [NOD-25] Fixed error message
2019-03-12 10:48:57 +02:00
Svarog
41647fd488 [DEV-376] Changed any instance of %v in format strings with a more specific format token (#188)
* [DEV-376] Changed any instance of %v in format strings with a more specific format token

* [DEV-376] Fixed some more wrong formatting strings + removed redundant
cast

* [DEV-376] Added fmt.Sprintf where it was missing

* [DEV-376] use %s for util.Amount, to invoke .String()

* [DEV-376] Some more fixes in format strings

* [DEV-376] fixed mruinvmap_test to expect the correct behaviour
2019-02-20 14:02:52 +02:00
Evgeny Khirin
100fbbaaa4 [DEV-361] Create type TxID as alias to daghash.Hash. (#175)
* [DEV-361] Create type TxID as alias to daghash.Hash. Use it for transaction IDs

* [DEV-361] Fixed missed renames

* [DEV-361] Removed usage of zeroHash

* [DEV-361] Fixed more missed renames
2019-01-27 14:27:10 +02:00
Ori Newman
b963c0d364
Dev 334 make id merkle root and transaction id, fix tests, and add new tests (#166)
* [DEV-329] Add TxID

* [DEV-329] Change Transaction inputs to reference by tx id instead of tx hash

* [DEV-329] Fix tests

* [DEV-329] change txhash to txid in mempool

* [DEV-334] Make IDMerkleRoot

* [DEV-329] Add txid that excludes payload, gas and ScriptSigs (#158)

* [DEV-329] Add TxID

* [DEV-329] Change Transaction inputs to reference by tx id instead of tx hash

* [DEV-329] Fix tests

* [DEV-329] change txhash to txid in mempool

* [DEV-329] replace thinEncoding bool with txEncoding bitmask

* [DEV-329] Change txencoding var names

* [DEV-329] change txEncodingexcludeSignatureScript -> txEncodingExcludeSignatureScript

* [DEV-334] Add IDMerkleRoot to blocknode and recalculate IDMerkleRoot when extraNonce is changed

* [DEV-334] Fix tests

* [DEV-334] Fix tests

* [DEV-334] fix SubnetworkDAGCoin -> SubnetworkIDNative

* [DEV-334] Add ID() function to Coin interface and rename hash to txID in a few places

* [DEV-334] Add Root method for merkle root

* [DEV-334] add comment to dag.SubnetworkID()

* [DEV-334] fix serializeSize comment
2019-01-23 14:04:23 +02:00
Svarog
53e8e5a10a [DEV-330] dagconfig coverage (#142)
* [DEV-314] Added tests for DisasmPC and DisasmScript

* [DEV-314] Re-wrote TestCheckErrorCondition to cover the whole method

* [DEV-314] Fixed error message

* [DEV-330] Covered all methods in daghash with tests

* [DEV-330] Added tests for NewHashFromString

* [DEV-330] Added test case for TestNewHashFromStr that is not the default daghash.Hash value
2019-01-03 14:38:51 +02:00
Ori Newman
7093155c3a [DEV-234] Add to txindex method to return the block in which tx was accepted (or indication it was not accepted) (#116)
* [DEV-234] add TxAcceptedInBlock and TxBlocks

* [DEV-234] test TxAcceptedInBlock and TxBlocks

* [DEV-234] test TxAcceptedInBlock and TxFirstBlockRegion

* [DEV-234] rename selectedPathSet to selectedPathChain

* [DEV-234] set indexers db as part of index manager initialization

* [DEV-234] remove redudant dag instance in txindex

* [DEV-234] fix TestTxIndexConnectBlock and add DAGParams as part of config in DAGSetup

* [DEV-234] TestTxIndexConnectBlock make K=1 to make calculations easier

* [DEV-234] rename TxAcceptingBlock to BlockThatAcceptedTx

* [DEV-234] update block fields names in txindex_test.go

* [DEV-234] rename selectedPathChain -> selectedPathChainSet
2018-11-05 16:11:54 +02:00
Svarog
35546b62d0
[DEV-240] Style fixes to satisfy golint (#112)
* [DEV-240] Unexport BlockDAG/SelectedTip, since it returns unexported *blockNode

* [DEV-240] Fix blockdag package comment to satisfy golint

* [DEV-240] Add comment explaining blank import of ffldb in blockdag/test_utils.go

* [DEV-240] Add comment to FullUTXOSet.Get

* [DEV-240] Unexported config.DefaultHomeDir

* [DEV-240] Remove blank import of ffldb from config/config.go

* [DEV-240] Added comment to daghash.Strings()

* [DEV-240] Added missing comments in hdkeychain/extendedkey.go

* [DEV-240] Re-activate goline in CI Dockerfile

* [DEV-240] Fixed some typos in comments

* [DEV-240] Typo fix in comment
2018-11-05 12:58:17 +02:00
Ori Newman
0643b0d920 [DEV-189] invert arguments order of daghash.Less (#83)
* [DEV-189] invert arguments order or daghash.Less

* [DEV-189] invert arguments order of daghash.Less in blockset.highest

* [DEV-189] change to equivalent condition in Hash.Less to make it prettier
2018-10-07 16:44:29 +03:00
Ori Newman
617530dd8f
[DEV-76] handleGetBlockTemplateLongPoll to use tips instead of tip (#52)
* [DEV-76] handleGetBlockTemplateLongPoll to use tips instead of tip

* [DEV-76] move concatHashesToString to  daghash package as JoinHashesStrings

* [DEV-76] use strings.Join for JoinHashesStrings

* [DEV-76] rename templateID -> longPollID

* [DEV-76] add function prefix to errors
2018-08-27 17:32:53 +03:00
Ori Newman
4b78fd007d [DEV-84] validate block parents order
* [DEV-84] validate block parents order

* [DEV-84] change AreEqual to look for order equality as well
2018-08-14 16:15:12 +03:00
Ori Newman
904f2cf2e3 [DEV-72] Write Blues()
* [DEV-62] add phantom constructs to blocknode

* [DEV-62] add phantom constructs to blocknode

* [DEV-72] write blues()

* [DEV-72] write blues()

* [DEV-72] write blues()

* [DEV-62] add comments to new phantom constructs in blocknode

* Fixed dbIndexConnectBlock. (#33)

* Fixed dbIndexConnectBlock.

* Removed redundant check in storeFilter.

* Created a new method to BlockHeader: IsGenesis.

* [DEV-71] Implement BlockHeap (#35)

* [DEV-71] Implemented BlockHeap.

* [DEV-71] Removed irrelevant comment.

* [DEV-71] Renamed variables in Pop() and split Less() to multiple lines.

* [DEV-72] write blues()

* [DEV-72] write blues()

* [DEV-72] write blues()

* [DEV-72] write blues tests

* [DEV-72] write blues tests

* [DEV-72] remove relevant past

* [DEV-72] write blues tests

* [DEV-72] write blues tests

* [DEV-72] write blues tests

* [DEV-72] write functions to order blockSet by hash and write blue tests

* [DEV-72] add secret mining and censorship attack tests

* [DEV-72] remove prints

* [DEV-72] remove K from dagconfig.Params

* [DEV-72] remove K from dagconfig.Params

* [DEV-72] change blueScore to uint64

* [DEV-72] block V was missing, so renamed w -> v, x -> w etc

* [DEV-72] use node.String instead of %v

* [DEV-72] block V was missing, so renamed w -> v, x -> w etc

* [DEV-72] add K to dagconfig.Params, and add expected reds to all phantom tests

* [DEV-72] set K=10 and add comments to phantom and phantom tests

* [DEV-72] fix formatting and add comments to TestPhantom

* [DEV-72] fix grammar
2018-08-02 16:34:40 +03:00
Svarog
19a043602b Dev 80 dagconfig coverage (#37)
* [DEV-80] Added tests for Strings(hashes)

* [DEV-80] Added tests for Bech32Prefix.To/FromString + DNSSeed.String()

* [DEV-80] Fixed namings of test variables
2018-07-29 10:46:17 +03:00
stasatdaglabs
f24673c396 [DEV-42] Update btcd package for DAG (#31)
* [DEV-42] Fixed rpcserverhelp.go.

* [DEV-42] Fixed GetBlockHeaderVerboseResult, GetBlockVerboseResult, and GetBlockTemplateResult.

* [DEV-42] Fixed rpcserver.go.

* [DEV-42] Got rid of the rescan command. Apparently it was deprecated and succeeded by the rescanBlocks command.

* [DEV-42] Modified handleRescanBlocks to satisfy compilation.

* [DEV-42] Fixed failing tests in rpcserver.go and rpcserverhelp.go.

* [DEV-42] Removed tests for rescan.

* [DEV-42] Removed rescan from notify.go.

* [DEV-42] Fixed a couple of comments I've missed.
2018-07-22 12:01:42 +03:00
stasatdaglabs
784839e8e7 [DEV-40] Update package mining and cpuminer for DAG (#28)
* [DEV-65] Renamed BestState to State and GetSnapshot to GetCurrentState.

* [DEV-65] Implemented State and SelectedTip, updated dagState (the serializable version of State), and updated State creations.

* [DEV-65] Fixed references to GetCurrentState and fixed tests.

* [DEV-40] Created a new method AreEquals for comparing hash slices. Updated mining package to work with primitive DAG.

* [DEV-65] Renamed State to DAGState, corrected comments, created a new thread-safe method setDAGState, fixed broken references I missed.

* [DEV-65] Converted dagState (the object) to dbDAGState, and made it serialize/deserialize into/out of JSON.

* [DEV-65] Renamed Txns to Txs and fixed a couple of comments.

* [DEV-65] Renamed some more "Txns" and removed some dead code.

* [DEV-40] Fixed formatting errors...

* [DEV-40] Reworded confusing test failure messages.

* [DEV-40] Fixed merge error.

* [DEV-40] Fixed style for AreEqual and TestAreEqual.
2018-07-18 11:54:17 +03:00
Stas Boutenko
a26fd21ae7 [DEV-32] Renamed chaincfg to dagconfig and chainhash to daghash. 2018-06-19 18:19:54 +03:00