Skip to content

Commit

Permalink
Enable Paris protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
e-asphyx committed Mar 20, 2024
1 parent 4ff21f0 commit 3040137
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 66 deletions.
5 changes: 5 additions & 0 deletions protocol/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/ecadlabs/gotez/v2/protocol/proto_016_PtMumbai"
"github.com/ecadlabs/gotez/v2/protocol/proto_017_PtNairob"
"github.com/ecadlabs/gotez/v2/protocol/proto_018_Proxford"
"github.com/ecadlabs/gotez/v2/protocol/proto_019_PtParisA"
)

type BlockInfo interface {
Expand All @@ -30,6 +31,8 @@ type BlockHeaderInfo interface {

func NewBlockInfo(proto *tz.ProtocolHash) (BlockInfo, error) {
switch *proto {
case core.Proto019PtParisA:
return new(proto_019_PtParisA.BlockInfo), nil
case core.Proto018Proxford:
return new(proto_018_Proxford.BlockInfo), nil
case core.Proto017PtNairob:
Expand All @@ -51,6 +54,8 @@ func NewBlockInfo(proto *tz.ProtocolHash) (BlockInfo, error) {

func NewBlockHeaderInfo(proto *tz.ProtocolHash) (BlockHeaderInfo, error) {
switch *proto {
case core.Proto019PtParisA:
return new(proto_019_PtParisA.BlockHeaderInfo), nil
case core.Proto018Proxford:
return new(proto_018_Proxford.BlockHeaderInfo), nil
case core.Proto017PtNairob:
Expand Down
3 changes: 3 additions & 0 deletions protocol/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ import (
"github.com/ecadlabs/gotez/v2/protocol/proto_016_PtMumbai"
"github.com/ecadlabs/gotez/v2/protocol/proto_017_PtNairob"
"github.com/ecadlabs/gotez/v2/protocol/proto_018_Proxford"
"github.com/ecadlabs/gotez/v2/protocol/proto_019_PtParisA"
)

func NewConstants(proto *tz.ProtocolHash) (constants core.Constants, err error) {
switch *proto {
case core.Proto019PtParisA:
constants = new(proto_019_PtParisA.Constants)
case core.Proto018Proxford:
constants = new(proto_018_Proxford.Constants)
case core.Proto017PtNairob:
Expand Down
3 changes: 3 additions & 0 deletions protocol/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ import (
"github.com/ecadlabs/gotez/v2/protocol/proto_016_PtMumbai"
"github.com/ecadlabs/gotez/v2/protocol/proto_017_PtNairob"
"github.com/ecadlabs/gotez/v2/protocol/proto_018_Proxford"
"github.com/ecadlabs/gotez/v2/protocol/proto_019_PtParisA"
)

func NewDelegateInfo(proto *tz.ProtocolHash) (delegate core.DelegateInfo, err error) {
switch *proto {
case core.Proto019PtParisA:
delegate = new(proto_019_PtParisA.DelegateInfo)
case core.Proto018Proxford:
delegate = new(proto_018_Proxford.DelegateInfo)
case core.Proto017PtNairob:
Expand Down
132 changes: 66 additions & 66 deletions protocol/proto_019_PtParisA/json_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3040137

Please sign in to comment.