mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
added ChecksumAddress according to https://github.com/ethereum/EIPs/issues/55
This commit is contained in:
parent
dbaed09e19
commit
416f46ac99
2 changed files with 1 additions and 5 deletions
|
|
@ -350,7 +350,6 @@ func zeroBytes(bytes []byte) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// for input read: https://github.com/ethereum/EIPs/issues/55
|
||||
// modelled after the JavaScript function toChecksumAddress()
|
||||
// Convert address into checksummed address
|
||||
|
|
@ -374,4 +373,3 @@ func ChecksumAddress(a common.Address) string {
|
|||
func ChecksumAddressHex(s string) string {
|
||||
return ChecksumAddress(common.HexToAddress(strings.Replace(strings.ToLower(s), "0x", "", 1)))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ import (
|
|||
"io/ioutil"
|
||||
"math/big"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
"strings"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/crypto/secp256k1"
|
||||
|
|
@ -249,7 +249,6 @@ func TestPythonIntegration(t *testing.T) {
|
|||
fmt.Printf("msg: %x, privkey: %x sig: %x\n", msg1, k1, sig1)
|
||||
}
|
||||
|
||||
|
||||
func TestChecksumAddress(t *testing.T) {
|
||||
// 4 groups of tests:
|
||||
// All caps
|
||||
|
|
@ -386,4 +385,3 @@ func TestChecksumAddressHex(t *testing.T) {
|
|||
}
|
||||
fmt.Printf("Passed %d tests and failed %d tests out of %d.\n", passed, failed, passed+failed)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue