Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
张蕾
Geth-Modification
Commits
c8b0afb2
Unverified
Commit
c8b0afb2
authored
May 11, 2023
by
Delweng
Committed by
GitHub
May 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ethclient: acquire the rpc.Client (#27246)
Signed-off-by:
jsvisa
<
delweng@gmail.com
>
parent
2169fa34
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
ethclient.go
ethclient/ethclient.go
+7
-0
No files found.
ethclient/ethclient.go
View file @
c8b0afb2
...
@@ -41,6 +41,7 @@ func Dial(rawurl string) (*Client, error) {
...
@@ -41,6 +41,7 @@ func Dial(rawurl string) (*Client, error) {
return
DialContext
(
context
.
Background
(),
rawurl
)
return
DialContext
(
context
.
Background
(),
rawurl
)
}
}
// DialContext connects a client to the given URL with context.
func
DialContext
(
ctx
context
.
Context
,
rawurl
string
)
(
*
Client
,
error
)
{
func
DialContext
(
ctx
context
.
Context
,
rawurl
string
)
(
*
Client
,
error
)
{
c
,
err
:=
rpc
.
DialContext
(
ctx
,
rawurl
)
c
,
err
:=
rpc
.
DialContext
(
ctx
,
rawurl
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -54,10 +55,16 @@ func NewClient(c *rpc.Client) *Client {
...
@@ -54,10 +55,16 @@ func NewClient(c *rpc.Client) *Client {
return
&
Client
{
c
}
return
&
Client
{
c
}
}
}
// Close closes the underlying RPC connection.
func
(
ec
*
Client
)
Close
()
{
func
(
ec
*
Client
)
Close
()
{
ec
.
c
.
Close
()
ec
.
c
.
Close
()
}
}
// Client gets the underlying RPC client.
func
(
ec
*
Client
)
Client
()
*
rpc
.
Client
{
return
ec
.
c
}
// Blockchain Access
// Blockchain Access
// ChainID retrieves the current chain ID for transaction replay protection.
// ChainID retrieves the current chain ID for transaction replay protection.
...
...
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