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
49b86a28
Unverified
Commit
49b86a28
authored
Sep 10, 2019
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common, graphql: fix hash/address decoding + UI content type
parent
cea2c804
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
types.go
common/types.go
+2
-2
graphiql.go
graphql/graphiql.go
+1
-1
No files found.
common/types.go
View file @
49b86a28
...
...
@@ -149,7 +149,7 @@ func (h *Hash) UnmarshalGraphQL(input interface{}) error {
var
err
error
switch
input
:=
input
.
(
type
)
{
case
string
:
*
h
=
HexToHash
(
input
)
err
=
h
.
UnmarshalText
([]
byte
(
input
)
)
default
:
err
=
fmt
.
Errorf
(
"Unexpected type for Bytes32: %v"
,
input
)
}
...
...
@@ -288,7 +288,7 @@ func (a *Address) UnmarshalGraphQL(input interface{}) error {
var
err
error
switch
input
:=
input
.
(
type
)
{
case
string
:
*
a
=
HexToAddress
(
input
)
err
=
a
.
UnmarshalText
([]
byte
(
input
)
)
default
:
err
=
fmt
.
Errorf
(
"Unexpected type for Address: %v"
,
input
)
}
...
...
graphql/graphiql.go
View file @
49b86a28
...
...
@@ -52,7 +52,7 @@ func (h GraphiQL) ServeHTTP(w http.ResponseWriter, r *http.Request) {
respond
(
w
,
errorJSON
(
"only GET requests are supported"
),
http
.
StatusMethodNotAllowed
)
return
}
w
.
Header
()
.
Set
(
"Content-Type"
,
"text/html"
)
w
.
Write
(
graphiql
)
}
...
...
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