Skip to content

Commit

Permalink
1193: Fix example errata (#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 #2319 (comment) and #2319 (comment).
  • Loading branch information
ryanio authored Dec 2, 2020
1 parent cc0c882 commit c13bb71
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 c13bb71

Please sign in to comment.