good morning!!!!

Skip to content
Snippets Groups Projects
Commit 4f2d6e5e authored by Garet Halliday's avatar Garet Halliday
Browse files

fix types.gotmpl

parent beccb5b4
No related branches found
No related tags found
No related merge requests found
......@@ -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"`
......
......@@ -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 -}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment