Prototyped new blockchain library and unit tests

This commit is contained in:
Chris Troutner
2020-01-27 15:46:37 -08:00
parent 725adc1ce1
commit 57f3454e88
5 changed files with 1343 additions and 20 deletions
+6 -6
View File
@@ -121,14 +121,14 @@ describe("#BlockchainRouter", () => {
it("should GET /getBestBlockHash", async () => {
// Mock the RPC call for unit tests.
// if (process.env.TEST === "unit") {
// nock(`${process.env.RPC_BASEURL}`)
// .post(uri => uri.includes("/"))
// .reply(200, { result: mockData.mockBlockHash })
// }
if (process.env.TEST === "unit") {
nock(`${process.env.RPC_BASEURL}`)
.post(uri => uri.includes("/"))
.reply(200, { result: mockData.mockBlockHash })
}
const result = await getBestBlockHash(req, res)
console.log(`result: ${util.inspect(result)}`)
// console.log(`result: ${util.inspect(result)}`)
assert.isString(result)
assert.equal(result.length, 64, "Hash string is fixed length")
File diff suppressed because it is too large Load Diff