-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Misc fixes for CCIP1.6 staging (#14665)
* Fix grpc creds, add balance * Add cap reg view * Lint * Pass in creds * Cap reg comment
- Loading branch information
1 parent
b13b8db
commit e82fb0c
Showing
7 changed files
with
69 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package v1_6 | ||
|
||
import ( | ||
"github.com/ethereum/go-ethereum/common" | ||
|
||
"github.com/smartcontractkit/chainlink/integration-tests/deployment/ccip/view/types" | ||
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" | ||
) | ||
|
||
// CapRegView denotes a view of the capabilities registry contract. | ||
// Note that the contract itself is 1.0.0 versioned, but we're releasing it first | ||
// as part of 1.6. | ||
type CapRegView struct { | ||
types.ContractMetaData | ||
Capabilities []CapabilityView `json:"capabilities,omitempty"` | ||
} | ||
|
||
type CapabilityView struct { | ||
LabelledName string `json:"labelledName"` | ||
Version string `json:"version"` | ||
ConfigContract common.Address `json:"configContract"` | ||
} | ||
|
||
func GenerateCapRegView(capReg *capabilities_registry.CapabilitiesRegistry) (CapRegView, error) { | ||
tv, err := types.NewContractMetaData(capReg, capReg.Address()) | ||
if err != nil { | ||
return CapRegView{}, err | ||
} | ||
caps, err := capReg.GetCapabilities(nil) | ||
if err != nil { | ||
return CapRegView{}, err | ||
} | ||
var capViews []CapabilityView | ||
for _, capability := range caps { | ||
capViews = append(capViews, CapabilityView{ | ||
LabelledName: capability.LabelledName, | ||
Version: capability.Version, | ||
ConfigContract: capability.ConfigurationContract, | ||
}) | ||
} | ||
return CapRegView{ | ||
ContractMetaData: tv, | ||
Capabilities: capViews, | ||
}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters