good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jrpc
Manage
Activity
Members
Labels
Plan
Issues
6
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
jrpc
Commits
4f2d6e5e
Commit
4f2d6e5e
authored
2 years ago
by
Garet Halliday
Browse files
Options
Downloads
Patches
Plain Diff
fix types.gotmpl
parent
beccb5b4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
openrpc/out/types.go
+26
-0
26 additions, 0 deletions
openrpc/out/types.go
openrpc/templates/types.gotmpl
+14
-18
14 additions, 18 deletions
openrpc/templates/types.gotmpl
with
40 additions
and
18 deletions
openrpc/out/types.go
+
26
−
0
View file @
4f2d6e5e
...
...
@@ -321,6 +321,12 @@ type SyncingStatus struct {
Option1
bool
}
type
Transaction1559Signed
struct
{
Field0
Transaction1559Unsigned
Field1
struct
{
R
Uint
`json:"r"`
S
Uint
`json:"s"`
YParity
Uint
`json:"yParity"`
}
}
type
Transaction1559Unsigned
struct
{
AccessList
AccessList
`json:"accessList"`
...
...
@@ -335,6 +341,12 @@ type Transaction1559Unsigned struct {
Value
Uint
`json:"value"`
}
type
Transaction2930Signed
struct
{
Field0
Transaction2930Unsigned
Field1
struct
{
R
Uint
`json:"r"`
S
Uint
`json:"s"`
YParity
Uint
`json:"yParity"`
}
}
type
Transaction2930Unsigned
struct
{
AccessList
AccessList
`json:"accessList"`
...
...
@@ -348,8 +360,22 @@ type Transaction2930Unsigned struct {
Value
Uint
`json:"value"`
}
type
TransactionInfo
struct
{
Field0
struct
{
BlockHash
Hash32
`json:"blockHash"`
BlockNumber
Uint
`json:"blockNumber"`
From
Address
`json:"from"`
Hash
Hash32
`json:"hash"`
TransactionIndex
Uint
`json:"transactionIndex"`
}
Field1
TransactionSigned
}
type
TransactionLegacySigned
struct
{
Field0
TransactionLegacyUnsigned
Field1
struct
{
R
Uint
`json:"r"`
S
Uint
`json:"s"`
V
Uint
`json:"v"`
}
}
type
TransactionLegacyUnsigned
struct
{
ChainId
Uint
`json:"chainId"`
...
...
This diff is collapsed.
Click to expand it.
openrpc/templates/types.gotmpl
+
14
−
18
View file @
4f2d6e5e
...
...
@@ -5,32 +5,28 @@ package main
{{define "schemaType" -}}
{{if not (eq .Ref "") -}}
{{camelCase (refName .Ref)}}
{{- else if eq .Type "object" -}}
{{- else if or
(not (eq (len .Properties) 0))
(not (eq (len .OneOf) 0))
(not (eq (len .AnyOf) 0))
(not (eq (len .AllOf) 0))
-}}
struct {
{{range $name, $property := .Properties -}}
{{camelCase $name}} {{template "schemaType" $property}} `json:"{{$name}}"`
{{end -}}
}
{{- else if eq .Type "array" -}}
[]{{template "schemaType" (index .Items 0)}}
{{- else if not (eq (len .OneOf) 0) -}}
struct{
{{range $idx, $v := .OneOf -}}
Option{{$idx}} {{template "schemaType" $v}}
{{range $idx, $property := .OneOf -}}
Option{{$idx}} {{template "schemaType" $property}}
{{end -}}
}
{{- else if not (eq (len .AnyOf) 0) -}}
struct{
{{range $idx, $v := .AnyOf -}}
Option{{$idx}} {{template "schemaType" $v}}
{{range $idx, $property := .AnyOf -}}
Option{{$idx}} {{template "schemaType" $property}}
{{end -}}
}
{{- else if not (eq (len .AllOf) 0) -}}
struct{
{{range $idx, $v := .AllOf -}}
Field{{$idx}} {{template "schemaType" $v}}
{{range $idx, $property := .AllOf -}}
Field{{$idx}} {{template "schemaType" $property}}
{{end -}}
}
{{- else if eq .Type "array" -}}
[]{{template "schemaType" (index .Items 0)}}
{{- else if not (eq (len .Enum) 0) -}}
string
{{- else -}}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment