Skip to content

Commit

Permalink
1193: Fix example errata (ethereum#3138)
Browse files Browse the repository at this point in the history
This PR fixes two errata in the EIP-1193 examples section, special thanks to @enolan for noting in ethereum#2319 (comment) and ethereum#2319 (comment).
  • Loading branch information
ryanio authored and Arachnid committed Mar 6, 2021
1 parent eda423f commit 062638e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions EIPS/eip-1193.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ ethereum
ethereum
.request({
method: 'eth_getBlockByNumber',
params: ['latest', 'true'],
params: ['latest', true],
})
.then((block) => {
console.log(`Block ${block.number}:`, block);
Expand Down Expand Up @@ -500,7 +500,7 @@ ethereum
if (message.type === 'eth_subscription') {
const { data } = message;
if (data.subscription === subscriptionId) {
if (typeof data.result === 'string' && data.result) {
if ('result' in data && typeof data.result === 'object') {
const block = data.result;
console.log(`New block ${block.number}:`, block);
} else {
Expand Down

0 comments on commit 062638e

Please sign in to comment.