Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
connorwstein committed Dec 6, 2024
1 parent f4de7d9 commit 7b17dac
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion deployment/address_book.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func AddressesContainBundle(addrs map[string]TypeAndVersion, wantTypes map[TypeA
if wantType == haveType {
counts[wantType]++
if counts[wantType] > 1 {
return false, fmt.Errorf("found more than one instance of a contract")
return false, fmt.Errorf("found more than one instance of contract %s", wantType)
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions deployment/common/changeset/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package changeset

import (
"errors"
"fmt"

"github.com/ethereum/go-ethereum/common"
owner_helpers "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers"
Expand Down Expand Up @@ -91,7 +92,7 @@ func MaybeLoadMCMSWithTimelockState(chain deployment.Chain, addresses map[string
timelock: {}, proposer: {}, canceller: {}, bypasser: {},
})
if err != nil {
return nil, err
return nil, fmt.Errorf("unable to check MCMS contracts on chain %s error: %w", chain.Name(), err)
}

for address, tvStr := range addresses {
Expand Down Expand Up @@ -142,7 +143,7 @@ func MaybeLoadLinkTokenState(chain deployment.Chain, addresses map[string]deploy
// Perhaps revisit if we have a use case for multiple.
_, err := deployment.AddressesContainBundle(addresses, map[deployment.TypeAndVersion]struct{}{linkToken: {}})
if err != nil {
return nil, err
return nil, fmt.Errorf("unable to check link token on chain %s error: %w", chain.Name(), err)
}
for address, tvStr := range addresses {
switch tvStr {
Expand Down Expand Up @@ -174,7 +175,7 @@ func MaybeLoadStaticLinkTokenState(chain deployment.Chain, addresses map[string]
// Perhaps revisit if we have a use case for multiple.
_, err := deployment.AddressesContainBundle(addresses, map[deployment.TypeAndVersion]struct{}{staticLinkToken: {}})
if err != nil {
return nil, err
return nil, fmt.Errorf("unable to check static link token on chain %s error: %w", chain.Name(), err)
}
for address, tvStr := range addresses {
switch tvStr {
Expand Down
10 changes: 5 additions & 5 deletions deployment/common/view/v1_0/link_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ type LinkTokenView struct {
func GenerateLinkTokenView(lt *link_token.LinkToken) (LinkTokenView, error) {
owner, err := lt.Owner(nil)
if err != nil {
return LinkTokenView{}, fmt.Errorf("failed to get owner: %w", err)
return LinkTokenView{}, fmt.Errorf("failed to get owner %s: %w", lt.Address(), err)
}
decimals, err := lt.Decimals(nil)
if err != nil {
return LinkTokenView{}, fmt.Errorf("failed to get decimals: %w", err)
return LinkTokenView{}, fmt.Errorf("failed to get decimals %s: %w", lt.Address(), err)
}
totalSupply, err := lt.TotalSupply(nil)
if err != nil {
return LinkTokenView{}, fmt.Errorf("failed to get total supply: %w", err)
return LinkTokenView{}, fmt.Errorf("failed to get total supply %s: %w", lt.Address(), err)
}
minters, err := lt.GetMinters(nil)
if err != nil {
return LinkTokenView{}, fmt.Errorf("failed to get minters: %w", err)
return LinkTokenView{}, fmt.Errorf("failed to get minters %s: %w", lt.Address(), err)
}
burners, err := lt.GetBurners(nil)
if err != nil {
return LinkTokenView{}, fmt.Errorf("failed to get burners: %w", err)
return LinkTokenView{}, fmt.Errorf("failed to get burners %s: %w", lt.Address(), err)
}
return LinkTokenView{
ContractMetaData: types.ContractMetaData{
Expand Down
4 changes: 2 additions & 2 deletions deployment/common/view/v1_0/static_link_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ type StaticLinkTokenView struct {
func GenerateStaticLinkTokenView(lt *link_token_interface.LinkToken) (StaticLinkTokenView, error) {
decimals, err := lt.Decimals(nil)
if err != nil {
return StaticLinkTokenView{}, fmt.Errorf("failed to get decimals: %w", err)
return StaticLinkTokenView{}, fmt.Errorf("failed to get decimals %s: %w", lt.Address(), err)
}
totalSupply, err := lt.TotalSupply(nil)
if err != nil {
return StaticLinkTokenView{}, fmt.Errorf("failed to get total supply: %w", err)
return StaticLinkTokenView{}, fmt.Errorf("failed to get total supply %s: %w", lt.Address(), err)
}
return StaticLinkTokenView{
ContractMetaData: types.ContractMetaData{
Expand Down

0 comments on commit 7b17dac

Please sign in to comment.