Adding Two Get Block Tests to SteemJs
Two Get Block Tests
SteemJs gives a good smoke test of a particular steemjs version.
addTest("steem.api.getBlock", async () => {
const data = await steemCall("getBlock", [102496700]);
if (data.previous === "061bf9bb3389a026b4e07f3b28aaa24d87c639e1") return;
throw new Error("getBlock return error");
});
steem.api.getDynamicGlobalProperties((err, result) => {
if (err) {
console.error(err);
return;
}
const latestBlock = result.head_block_number;
log('Latest block height:', latestBlock);
addTest(`steem.api.getBlock (latest block height ${latestBlock})`, async () => {
const data = await steemCall("getBlock", [latestBlock]);
log(data);
if (data.previous && data.witness && data.timestamp && data.witness_signature) return;
throw new Error(`getBlock (latest block height: ${latestBlock}) return error`);
})
});
Steem to the Moon🚀!
- You can rent Steem Power via rentsp!
- You can swap the TRON:TRX/USDT/USDD to STEEM via tron2steem!
- You can swap the STEEM/SBD to SUI via steem2sui!
- You can swap the STEEM/SBD to SOL Solana via steem2sol!
- You can swap the STEEM/SBD to ETH Ethereum via steem2eth!
- You can swap the STEEM/SBD to Tether USDT (TRC-20) via steem2usdt!
- You can swap the STEEM/SBD to TRX (TRON) via steem2trx!
- You can swap the STEEM/SBD to BTS (BitShares) via steem2bts!
- Register a free STEEM account at SteemYY!
- Steem Block Explorer
- ChatGPT/Steem Integration: You can type !ask command to invoke ChatGPT
- Steem Witness Table and API
- Other Steem Tools
Support me, thank you!
Why you should vote me? My contributions
Please vote me as a witness or set me as a proxy via https://steemitwallet.com/~witnesses




Great post! Featured in the hot section by @punicwax.