Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
e10132e4
Unverified
Commit
e10132e4
authored
Apr 12, 2021
by
Mark Tyneway
Committed by
GitHub
Apr 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
geth: only accept txs with a 0 value (#435)
parent
8ae059c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
rpc.spec.ts
integration-tests/test/rpc.spec.ts
+11
-0
api_backend.go
l2geth/eth/api_backend.go
+5
-0
No files found.
integration-tests/test/rpc.spec.ts
View file @
e10132e4
...
...
@@ -51,6 +51,17 @@ describe('Basic RPC tests', () => {
provider
.
sendTransaction
(
await
wallet
.
signTransaction
(
tx
))
).
to
.
be
.
rejectedWith
(
'
Cannot submit unprotected transaction
'
)
})
it
(
'
should not accept a transaction with a value
'
,
async
()
=>
{
const
tx
=
{
...
DEFAULT_TRANSACTION
,
chainId
:
(
await
wallet
.
getChainId
()),
value
:
100
,
}
await
expect
(
provider
.
sendTransaction
(
await
wallet
.
signTransaction
(
tx
))
).
to
.
be
.
rejectedWith
(
'
Cannot send transaction with non-zero value. Use WETH.transfer()
'
)
})
})
describe
(
'
eth_getTransactionByHash
'
,
()
=>
{
...
...
l2geth/eth/api_backend.go
View file @
e10132e4
...
...
@@ -294,6 +294,11 @@ func (b *EthAPIBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscri
// a lock can be used around the remotes for when the sequencer is reorganizing.
func
(
b
*
EthAPIBackend
)
SendTx
(
ctx
context
.
Context
,
signedTx
*
types
.
Transaction
)
error
{
if
b
.
UsingOVM
{
// The value field is not rolled up so it must be set to 0
if
signedTx
.
Value
()
.
Cmp
(
new
(
big
.
Int
))
!=
0
{
return
fmt
.
Errorf
(
"Cannot send transaction with non-zero value. Use WETH.transfer()"
)
}
to
:=
signedTx
.
To
()
if
to
!=
nil
{
if
*
to
==
(
common
.
Address
{})
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment