2015-05-22 14:03:22 -07:00
|
|
|
package core
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
|
|
|
)
|
|
|
|
|
2015-05-22 23:05:56 -07:00
|
|
|
func NameRegEntry(name string) (*ctypes.ResponseNameRegEntry, error) {
|
2015-05-22 14:03:22 -07:00
|
|
|
st := consensusState.GetState() // performs a copy
|
|
|
|
entry := st.GetNameRegEntry(name)
|
|
|
|
if entry == nil {
|
|
|
|
return nil, fmt.Errorf("Name %s not found", name)
|
|
|
|
}
|
|
|
|
return &ctypes.ResponseNameRegEntry{entry}, nil
|
|
|
|
}
|