Skip to content

Commit

Permalink
review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
AnieeG committed Dec 6, 2024
1 parent 45f4625 commit 2755289
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions deployment/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,19 @@ type OffchainClient interface {
type Chain struct {
// Selectors used as canonical chain identifier.
Selector uint64
name string
Client OnchainClient
// Note the Sign function can be abstract supporting a variety of key storage mechanisms (e.g. KMS etc).
DeployerKey *bind.TransactOpts
Confirm func(tx *types.Transaction) (uint64, error)
}

func (c Chain) Name() string {
return c.name
}

func (c Chain) mustSetName() {
chainInfo, err := ChainInfo(c.Selector)
if err != nil {
// we should never get here, if the selector is invalid it should not be in the environment
panic(err)
}
c.name = chainInfo.ChainName
return chainInfo.ChainName
}

// Environment represents an instance of a deployed product
Expand Down Expand Up @@ -102,9 +97,6 @@ func NewEnvironment(
offchain OffchainClient,
ctx func() context.Context,
) *Environment {
for i := range chains {
chains[i].mustSetName()
}
return &Environment{
Name: name,
Logger: logger,
Expand Down

0 comments on commit 2755289

Please sign in to comment.