mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00

* RPC: include orphans into mempool entries * no need for + 1 * give request option to choose mempool pool(s) * add to wallet, fix bg * use orphanpool rpc to test for orphans * fix fmt * fix crash when quering orphan pool in get_mempool_entries * pass the tests, fix fromAppMessage bug * Update config_test.go don't think this is needed * needed for tests to pass * inverse to transactionpoolfilter, cut down code to two ifs. * fmt * update test to true false, forgot one includetransactionpool renaming * update and simplyfiy get_mempool_entry handler * comment outdated * i think we usually use make instead of var. * Fix some leftovers of includeTransactionPool Co-authored-by: Ori Newman <orinewman1@gmail.com>
73 lines
2.2 KiB
Go
73 lines
2.2 KiB
Go
package integration
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/kaspanet/kaspad/domain/dagconfig"
|
|
"github.com/kaspanet/kaspad/infrastructure/config"
|
|
)
|
|
|
|
const (
|
|
p2pAddress1 = "127.0.0.1:54321"
|
|
p2pAddress2 = "127.0.0.1:54322"
|
|
p2pAddress3 = "127.0.0.1:54323"
|
|
p2pAddress4 = "127.0.0.1:54324"
|
|
p2pAddress5 = "127.0.0.1:54325"
|
|
|
|
rpcAddress1 = "127.0.0.1:12345"
|
|
rpcAddress2 = "127.0.0.1:12346"
|
|
rpcAddress3 = "127.0.0.1:12347"
|
|
rpcAddress4 = "127.0.0.1:12348"
|
|
rpcAddress5 = "127.0.0.1:12349"
|
|
|
|
miningAddress1 = "kaspasim:qqqqnc0pxg7qw3qkc7l6sge8kfhsvvyt7mkw8uamtndqup27ftnd6c769gn66"
|
|
miningAddress1PrivateKey = "0d81045b0deb2af36a25403c2154c87aa82d89dd337b575bae27ce7f5de53cee"
|
|
|
|
miningAddress2 = "kaspasim:qqqqnc0pxg7qw3qkc7l6sge8kfhsvvyt7mkw8uamtndqup27ftnd6c769gn66"
|
|
miningAddress2PrivateKey = "0d81045b0deb2af36a25403c2154c87aa82d89dd337b575bae27ce7f5de53cee"
|
|
|
|
miningAddress3 = "kaspasim:qqq754f2gdcjcnykwuwwr60c82rh5u6mxxe7yqxljnrxz9fu0h95kduq9ezng"
|
|
miningAddress3PrivateKey = "f6c8f31fd359cbb97007034780bc4021f6ad01c6bc10499b79849efd4cc7ca39"
|
|
|
|
defaultTimeout = 30 * time.Second
|
|
)
|
|
|
|
func setConfig(t *testing.T, harness *appHarness, protocolVersion uint32) {
|
|
harness.config = commonConfig()
|
|
harness.config.AppDir = randomDirectory(t)
|
|
harness.config.Listeners = []string{harness.p2pAddress}
|
|
harness.config.RPCListeners = []string{harness.rpcAddress}
|
|
harness.config.UTXOIndex = harness.utxoIndex
|
|
harness.config.AllowSubmitBlockWhenNotSynced = true
|
|
if protocolVersion != 0 {
|
|
harness.config.ProtocolVersion = protocolVersion
|
|
}
|
|
|
|
if harness.overrideDAGParams != nil {
|
|
harness.config.ActiveNetParams = harness.overrideDAGParams
|
|
}
|
|
}
|
|
|
|
func commonConfig() *config.Config {
|
|
commonConfig := config.DefaultConfig()
|
|
|
|
*commonConfig.ActiveNetParams = dagconfig.SimnetParams // Copy so that we can make changes safely
|
|
commonConfig.ActiveNetParams.BlockCoinbaseMaturity = 10
|
|
commonConfig.TargetOutboundPeers = 0
|
|
commonConfig.DisableDNSSeed = true
|
|
commonConfig.Simnet = true
|
|
|
|
return commonConfig
|
|
}
|
|
|
|
func randomDirectory(t *testing.T) string {
|
|
dir, err := ioutil.TempDir("", "integration-test")
|
|
if err != nil {
|
|
t.Fatalf("Error creating temporary directory for test: %+v", err)
|
|
}
|
|
|
|
return dir
|
|
}
|