2019-07-05 14:29:17 +00:00
|
|
|
package address
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
|
|
|
// NewForTestGetter returns a closure that returns an address unique to that invocation.
|
|
|
|
// The address is unique wrt the closure returned, not globally.
|
|
|
|
func NewForTestGetter() func() Address {
|
|
|
|
i := 0
|
|
|
|
return func() Address {
|
|
|
|
s := fmt.Sprintf("address%d", i)
|
|
|
|
i++
|
|
|
|
newAddr, err := NewActorAddress([]byte(s))
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return newAddr
|
|
|
|
}
|
2019-07-05 14:36:08 +00:00
|
|
|
}
|