-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Wrong chain ID in error message when chain not found
fix: Chain lookup done even when network prefix in chain ID is wrong
- Loading branch information
Nikita Nikolashyn
committed
Jul 25, 2024
1 parent
d2f4efb
commit c22ab14
Showing
7 changed files
with
46 additions
and
12 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
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,31 @@ | ||
package interfaces | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/iotaledger/wasp/packages/isc" | ||
) | ||
|
||
var ( | ||
ErrCantDeleteLastUser = errors.New("you can't delete the last user") | ||
) | ||
|
||
func NewChainNotFoundError(chainID isc.ChainID) error { | ||
return ChainNotFoundError{ | ||
ChainID: chainID, | ||
} | ||
} | ||
|
||
type ChainNotFoundError struct { | ||
ChainID isc.ChainID | ||
} | ||
|
||
func (e ChainNotFoundError) Error() string { | ||
errStr := "Chain not found" | ||
|
||
if !e.ChainID.Empty() { | ||
errStr = errStr + ": " + e.ChainID.String() | ||
} | ||
|
||
return errStr | ||
} |
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