29 lines
757 B
Go
29 lines
757 B
Go
package zcash2cwtch
|
|
|
|
import (
|
|
"cwtch.im/zcash2cwtch"
|
|
"encoding/json"
|
|
"git.openprivacy.ca/openprivacy/libricochet-go/log"
|
|
"io/ioutil"
|
|
"testing"
|
|
)
|
|
|
|
type ZcashConfig struct {
|
|
Username string `json:"username"`
|
|
Password string `json:"password"`
|
|
}
|
|
|
|
func TestNewZValidateAddress(t *testing.T) {
|
|
log.SetLevel(log.LevelDebug)
|
|
configFile, _ := ioutil.ReadFile("config.json")
|
|
config := ZcashConfig{}
|
|
_ = json.Unmarshal(configFile, &config)
|
|
|
|
zc := zcashrpc.NewLocalClient(config.Username, config.Password)
|
|
result, err := zc.ValidateAddress("zs1pjv7eneq9jshw0eyywpruv2cetl74sh84ymdnyv4c4vg8vl5k2qmlv0n7ye77g49lhqkg75v52f")
|
|
t.Logf("Result: %v %v", result, err)
|
|
if err != nil || result.IsValid == false {
|
|
t.Errorf("Failed to validate real zaddress")
|
|
}
|
|
}
|