71 lines
1.4 KiB
Go
71 lines
1.4 KiB
Go
// +build integration
|
|
|
|
package dogecoin
|
|
|
|
import (
|
|
"blockbook/bchain"
|
|
"blockbook/bchain/tests/rpc"
|
|
"encoding/json"
|
|
"flag"
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func getRPCClient(cfg json.RawMessage) (bchain.BlockChain, error) {
|
|
c, err := NewDogecoinRPC(cfg, nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
cli := c.(*DogecoinRPC)
|
|
cli.Parser = NewDogecoinParser(GetChainParams("main"), cli.ChainConfig)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
cli.Mempool = bchain.NewUTXOMempool(cli, cli.ChainConfig.MempoolWorkers, cli.ChainConfig.MempoolSubWorkers)
|
|
return cli, nil
|
|
}
|
|
|
|
var rpcTest *rpc.Test
|
|
|
|
func TestMain(m *testing.M) {
|
|
flag.Parse()
|
|
t, err := rpc.NewTest("Dogecoin", getRPCClient)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
rpcTest = t
|
|
|
|
os.Exit(m.Run())
|
|
}
|
|
|
|
func TestDogecoinRPC_GetBlockHash(t *testing.T) {
|
|
rpcTest.TestGetBlockHash(t)
|
|
}
|
|
|
|
func TestDogecoinRPC_GetBlock(t *testing.T) {
|
|
rpcTest.TestGetBlock(t)
|
|
}
|
|
|
|
func TestDogecoinRPC_GetTransaction(t *testing.T) {
|
|
rpcTest.TestGetTransaction(t)
|
|
}
|
|
|
|
func TestDogecoinRPC_GetTransactionForMempool(t *testing.T) {
|
|
rpcTest.TestGetTransactionForMempool(t)
|
|
}
|
|
|
|
func TestDogecoinRPC_MempoolSync(t *testing.T) {
|
|
rpcTest.TestMempoolSync(t)
|
|
}
|
|
|
|
func TestDogecoinRPC_EstimateSmartFee(t *testing.T) {
|
|
t.Skip("skipping test, unreliable")
|
|
// rpcTest.TestEstimateSmartFee(t)
|
|
}
|
|
|
|
func TestDogecoinRPC_EstimateFee(t *testing.T) {
|
|
t.Skip("skipping test, unreliable")
|
|
// rpcTest.TestEstimateFee(t)
|
|
}
|