Skip to content

Commit

Permalink
Node: Add Optimism chainID (wormhole-foundation#1867)
Browse files Browse the repository at this point in the history
Change-Id: Ic86d9ff02c8ab486e8fae077f21c833de156a9d8
  • Loading branch information
bruce-riley authored Nov 8, 2022
1 parent 8d23de5 commit 51eac51
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sdk/vaa/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ func (c ChainID) String() string {
return "injective"
case ChainIDArbitrum:
return "arbitrum"
case ChainIDOptimism:
return "optimism"
case ChainIDPythNet:
return "pythnet"
case ChainIDWormchain:
Expand Down Expand Up @@ -245,6 +247,8 @@ func ChainIDFromString(s string) (ChainID, error) {
return ChainIDInjective, nil
case "arbitrum":
return ChainIDArbitrum, nil
case "optimism":
return ChainIDOptimism, nil
case "pythnet":
return ChainIDPythNet, nil
case "wormchain":
Expand Down Expand Up @@ -302,6 +306,8 @@ const (
ChainIDAptos ChainID = 22
// ChainIDArbitrum is the ChainID of Arbitrum
ChainIDArbitrum ChainID = 23
// ChainIDOptimism is the ChainID of Optimism
ChainIDOptimism ChainID = 24
// ChainIDPythNet is the ChainID of PythNet
ChainIDPythNet ChainID = 26
// ChainIDXpla is the ChainID of Xpla
Expand Down
2 changes: 2 additions & 0 deletions sdk/vaa/structs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func TestChainIDFromString(t *testing.T) {
{input: "Terra2", output: ChainIDTerra2},
{input: "Injective", output: ChainIDInjective},
{input: "Arbitrum", output: ChainIDArbitrum},
{input: "Optimism", output: ChainIDOptimism},
{input: "XPLA", output: ChainIDXpla},
{input: "Wormchain", output: ChainIDWormchain},
{input: "wormchain", output: ChainIDWormchain},
Expand Down Expand Up @@ -166,6 +167,7 @@ func TestChainId_String(t *testing.T) {
{input: 21, output: "sui"},
{input: 22, output: "aptos"},
{input: 23, output: "arbitrum"},
{input: 24, output: "optimism"},
{input: 28, output: "xpla"},
{input: 3104, output: "wormchain"},
}
Expand Down

0 comments on commit 51eac51

Please sign in to comment.