Test active addresses including script addrs.
This commit is contained in:
parent
5a3be85bf4
commit
ff7ecf5e54
1 changed files with 36 additions and 0 deletions
|
@ -994,6 +994,23 @@ func TestImportScript(t *testing.T) {
|
|||
return
|
||||
}
|
||||
|
||||
// Check that it's included along with the active payment addresses.
|
||||
found := false
|
||||
for _, wa := range w.SortedActiveAddresses() {
|
||||
if wa.Address() == address {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
t.Errorf("Imported script address was not returned with sorted active payment addresses.")
|
||||
return
|
||||
}
|
||||
if _, ok := w.ActiveAddresses()[address]; !ok {
|
||||
t.Errorf("Imported script address was not returned with unsorted active payment addresses.")
|
||||
return
|
||||
}
|
||||
|
||||
// serialise and deseralise and check still there.
|
||||
|
||||
// Test (de)serialization of wallet.
|
||||
|
@ -1082,6 +1099,25 @@ func TestImportScript(t *testing.T) {
|
|||
return
|
||||
}
|
||||
|
||||
// Check that it's included along with the active payment addresses.
|
||||
found = false
|
||||
for _, wa := range w.SortedActiveAddresses() {
|
||||
if wa.Address() == address {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
t.Errorf("After reserialiation, imported script address was not returned with sorted " +
|
||||
"active payment addresses.")
|
||||
return
|
||||
}
|
||||
if _, ok := w.ActiveAddresses()[address]; !ok {
|
||||
t.Errorf("After reserialiation, imported script address was not returned with unsorted " +
|
||||
"active payment addresses.")
|
||||
return
|
||||
}
|
||||
|
||||
// Mark imported address as partially synced with a block somewhere inbetween
|
||||
// the import height and the chain height.
|
||||
partialHeight := (createHeight-importHeight)/2 + importHeight
|
||||
|
|
Loading…
Reference in a new issue