Debug fetch requests

This commit is contained in:
Garrett Mills 2021-04-10 23:45:50 -05:00
parent 5555d63f5d
commit d8da4e012f
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246

View File

@ -226,6 +226,7 @@ export class Blockchain extends Unit {
try { try {
this.logging.verbose(`Making request to: ${peer.host}api/v1/chain/submit`) this.logging.verbose(`Making request to: ${peer.host}api/v1/chain/submit`)
const result = await fetch(`${peer.host}api/v1/chain/submit`).then(res => res.json()) const result = await fetch(`${peer.host}api/v1/chain/submit`).then(res => res.json())
console.log('got result after making request', result)
const blocks: unknown = result.data?.data?.records const blocks: unknown = result.data?.data?.records
if ( Array.isArray(blocks) && blocks.every(block => { if ( Array.isArray(blocks) && blocks.every(block => {
return isBlockResourceItem(block) return isBlockResourceItem(block)