Skip to content

Commit

Permalink
improve eth_sendtransaction args validation (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
mindofmar authored Dec 7, 2023
1 parent 15153ab commit d0a49ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/injected/injectWalletGuard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const addWalletGuardProxy = (provider: any) => {
let response;

if (request.method === 'eth_sendTransaction') {
if (request.params.length !== 1) {
if (request.params.length < 1) {
// Forward the request anyway.
log.warn('Unexpected argument length.');
return Reflect.apply(target, thisArg, args);
Expand Down Expand Up @@ -271,7 +271,7 @@ const addWalletGuardProxy = (provider: any) => {
}

if (request.method === 'eth_sendTransaction') {
if (request.params.length !== 1) {
if (request.params.length < 1) {
// Forward the request anyway.
log.warn('Unexpected argument length.');
return Reflect.apply(target, thisArg, args);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/simulation/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class RequestManager {
method: args.method,
};
} else {
console.warn('Unexpected Request', args);
console.warn('Unexpected Request');
request = {
...args,
id,
Expand Down

0 comments on commit d0a49ea

Please sign in to comment.