diff --git a/server/public_test.go b/server/public_test.go index 3d34be2e..5a6c8c4b 100644 --- a/server/public_test.go +++ b/server/public_test.go @@ -134,8 +134,56 @@ func Test_PublicServer_UTXO(t *testing.T) { ``, }, }, - // explorerSpendingTx - // explorerBlocks + { + name: "explorerAddress", + r: newGetRequest(ts.URL+"/address/mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz", nil), + status: http.StatusOK, + contentType: "text/html; charset=utf-8", + body: []string{ + `Bitcoin Testnet Explorer`, + `

Address`, + `0 TEST`, + `mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz`, + `0.00012345 TEST`, + `7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25`, + `3172.83951061 TEST `, + `mtR97eM2HPWVM6c8FGLGcukgaHHQv7THoL`, + `td>mtR97eM2HPWVM6c8FGLGcukgaHHQv7THoL`, + `9172.83951061 TEST ×`, + `00b2c06055e5e90e9c82bd4181fde310104391a7fa4f289b1704e5d90caa3840`, + ``, + }, + }, + { + name: "explorerSpendingTx", + r: newGetRequest(ts.URL+"/spending/7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25/0", nil), + status: http.StatusOK, + contentType: "text/html; charset=utf-8", + body: []string{ + `Bitcoin Testnet Explorer`, + `

Transaction

`, + `3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71`, + `0.00000062 TEST`, + ``, + }, + }, + { + name: "explorerBlocks", + r: newGetRequest(ts.URL+"/blocks", nil), + status: http.StatusOK, + contentType: "text/html; charset=utf-8", + body: []string{ + `Bitcoin Testnet Explorer`, + `

Blocks`, + `225494`, + `00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6`, + `0000000076fbbed90fd75b0e18856aa35baa984e9c9d444cf746ad85e94e2997`, + `Tue, 21 Aug 2018 15:27:01 CEST`, + `2`, + `1234567`, + ``, + }, + }, { name: "explorerBlock", r: newGetRequest(ts.URL+"/block/225494", nil), diff --git a/tests/dbtestdata/fakechain.go b/tests/dbtestdata/fakechain.go index e17c64c5..a155da27 100644 --- a/tests/dbtestdata/fakechain.go +++ b/tests/dbtestdata/fakechain.go @@ -178,7 +178,7 @@ func (c *fakeBlockChain) GetMempoolTransactions(address string) (v []string, err } func (c *fakeBlockChain) GetMempoolTransactionsForAddrDesc(addrDesc bchain.AddressDescriptor) (v []string, err error) { - return nil, errors.New("Not implemented") + return []string{}, nil } func (c *fakeBlockChain) GetMempoolEntry(txid string) (v *bchain.MempoolEntry, err error) {