mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
Update rules.md
Improved Readability: Clear variable names and consistent formatting. Explicit Handling: Added an explicit return statement for cases that require manual review for enhanced clarity.
This commit is contained in:
parent
44a50c9f96
commit
af56feeed1
1 changed files with 9 additions and 8 deletions
|
|
@ -214,14 +214,15 @@ function OnApprovedTx(resp) {
|
||||||
## Example 2: allow destination
|
## Example 2: allow destination
|
||||||
|
|
||||||
```js
|
```js
|
||||||
function ApproveTx(r) {
|
function ApproveTx(request) {
|
||||||
if (r.transaction.from.toLowerCase() == "0x0000000000000000000000000000000000001337") {
|
const sender = request.transaction.from.toLowerCase();
|
||||||
return "Approve"
|
if (sender === "0x0000000000000000000000000000000000001337") {
|
||||||
}
|
return "Approve";
|
||||||
if (r.transaction.from.toLowerCase() == "0x000000000000000000000000000000000000dead") {
|
}
|
||||||
return "Reject"
|
if (sender === "0x000000000000000000000000000000000000dead") {
|
||||||
}
|
return "Reject";
|
||||||
// Otherwise goes to manual processing
|
}
|
||||||
|
return "Manual Review"; // Explicit return for clarity
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue