Skip to content

Commit

Permalink
corrected type assertion error when deriving publicKey from privateKey
Browse files Browse the repository at this point in the history
  • Loading branch information
zeddee committed Jan 4, 2019
1 parent 8ce38c4 commit 40e4f93
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion en/signature-verify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func main() {
publicKey := privateKey.Public()
publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey)
if !ok {
log.Fatal("error casting public key to ECDSA")
log.Fatal("cannot assert type: publicKey is not of type *ecdsa.PublicKey")
}

publicKeyBytes := crypto.FromECDSAPub(publicKeyECDSA)
Expand Down
2 changes: 1 addition & 1 deletion en/smart-contract-deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func main() {
publicKey := privateKey.Public()
publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey)
if !ok {
log.Fatal("error casting public key to ECDSA")
log.Fatal("cannot assert type: publicKey is not of type *ecdsa.PublicKey")
}

fromAddress := crypto.PubkeyToAddress(*publicKeyECDSA)
Expand Down
4 changes: 2 additions & 2 deletions en/smart-contract-write/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if err != nil {
publicKey := privateKey.Public()
publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey)
if !ok {
log.Fatal("error casting public key to ECDSA")
log.Fatal("cannot assert type: publicKey is not of type *ecdsa.PublicKey")
}

fromAddress := crypto.PubkeyToAddress(*publicKeyECDSA)
Expand Down Expand Up @@ -158,7 +158,7 @@ func main() {
publicKey := privateKey.Public()
publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey)
if !ok {
log.Fatal("error casting public key to ECDSA")
log.Fatal("cannot assert type: publicKey is not of type *ecdsa.PublicKey")
}

fromAddress := crypto.PubkeyToAddress(*publicKeyECDSA)
Expand Down
2 changes: 1 addition & 1 deletion en/transaction-raw-create/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func main() {
publicKey := privateKey.Public()
publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey)
if !ok {
log.Fatal("error casting public key to ECDSA")
log.Fatal("cannot assert type: publicKey is not of type *ecdsa.PublicKey")
}

fromAddress := crypto.PubkeyToAddress(*publicKeyECDSA)
Expand Down
2 changes: 1 addition & 1 deletion en/transfer-tokens/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func main() {
publicKey := privateKey.Public()
publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey)
if !ok {
log.Fatal("error casting public key to ECDSA")
log.Fatal("cannot assert type: publicKey is not of type *ecdsa.PublicKey")
}

fromAddress := crypto.PubkeyToAddress(*publicKeyECDSA)
Expand Down
4 changes: 2 additions & 2 deletions en/wallet-generate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Converting it to hex is a similar process that we went through with the private
```go
publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey)
if !ok {
log.Fatal("error casting public key to ECDSA")
log.Fatal("cannot assert type: publicKey is not of type *ecdsa.PublicKey")
}

publicKeyBytes := crypto.FromECDSAPub(publicKeyECDSA)
Expand Down Expand Up @@ -91,7 +91,7 @@ func main() {
publicKey := privateKey.Public()
publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey)
if !ok {
log.Fatal("error casting public key to ECDSA")
log.Fatal("cannot assert type: publicKey is not of type *ecdsa.PublicKey")
}

publicKeyBytes := crypto.FromECDSAPub(publicKeyECDSA)
Expand Down

0 comments on commit 40e4f93

Please sign in to comment.