mirror of
https://github.com/status-im/EIPs.git
synced 2025-02-22 03:38:09 +00:00
1193: Fix example errata (#3138)
This PR fixes two errata in the EIP-1193 examples section, special thanks to @enolan for noting in https://github.com/ethereum/EIPs/issues/2319#issuecomment-734159349 and https://github.com/ethereum/EIPs/issues/2319#issuecomment-734169215.
This commit is contained in:
parent
cc0c882df5
commit
c13bb718e2
@ -464,7 +464,7 @@ ethereum
|
||||
ethereum
|
||||
.request({
|
||||
method: 'eth_getBlockByNumber',
|
||||
params: ['latest', 'true'],
|
||||
params: ['latest', true],
|
||||
})
|
||||
.then((block) => {
|
||||
console.log(`Block ${block.number}:`, block);
|
||||
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user