Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Kolezhniuk committed Dec 6, 2023
1 parent 87ce330 commit 7d55e56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ func ChainIDfromDID(did w3c.DID) (ChainID, error) {

// RegisterChainID registers chainID for blockchain and network
func RegisterChainID(blockchain Blockchain, network NetworkID, chainID int) error {

k := fmt.Sprintf("%s:%s", blockchain, network)
if existingChainID, ok := chainIDs[k]; ok && existingChainID != ChainID(chainID) {
existingChainID, ok := chainIDs[k]
if ok && existingChainID != ChainID(chainID) {
return fmt.Errorf("chainID %s:%s already registered", blockchain, network)
}
chainIDs[k] = ChainID(chainID)
Expand Down
4 changes: 2 additions & 2 deletions did.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ var DIDMethodByte = map[DIDMethod]byte{

// RegisterDIDMethod registers new DID method with byte flag
func RegisterDIDMethod(m DIDMethod, b byte) error {

if existingByte, ok := DIDMethodByte[m]; ok && existingByte != b {
existingByte, ok := DIDMethodByte[m]
if ok && existingByte != b {
return fmt.Errorf("DID method %s already registered", m)
}

Expand Down

0 comments on commit 7d55e56

Please sign in to comment.