@ -243,7 +243,7 @@ func testNameReg(t *testing.T, typ string) {
// update the data as the owner, make sure still there
numDesiredBlocks=int64(2)
data="these are amongst the things I wish to bestow upon the youth of generations come: a safe supply of honey, and a better money. For what else shall they need"
datas:=[]string{"cold&warm","!@#$%^&*()","<<<>>>>","because why would you ever need a ~ or a & or even a % in a json file? make your case and we'll talk"}
data="on this side of neptune there are 1234567890 people: first is OMNIVORE. Or is it. Ok this is pretty restrictive. No exclamations :(. Faces tho :')"
data="on this side of neptune there are 1234567890 people: first is OMNIVORE+-3. Or is it. Ok this is pretty restrictive. No exclamations :(. Faces tho :')"
data="In the beginning there was no thing, not even the beginning. It hadn't been here, no there, nor for that matter anywhere, not especially because it had not to even exist, let alone to not. Nothing especially odd about that."
@ -220,30 +227,26 @@ func (tx *NameTx) WriteSignBytes(chainID string, w io.Writer, n *int64, err *err
func(tx*NameTx)ValidateStrings()error{
iflen(tx.Name)==0{
returnerrors.New("Name must not be empty")
returnErrTxInvalidString{"Name must not be empty"}
}
iflen(tx.Name)>MaxNameLength{
returnerrors.New(Fmt("Name is too long. Max %d bytes",MaxNameLength))
returnErrTxInvalidString{Fmt("Name is too long. Max %d bytes",MaxNameLength)}
}
iflen(tx.Data)>MaxDataLength{
returnerrors.New(Fmt("Data is too long. Max %d bytes",MaxDataLength))
returnErrTxInvalidString{Fmt("Data is too long. Max %d bytes",MaxDataLength)}
}
if!validateNameRegEntryName(tx.Name){
returnerrors.New(Fmt("Invalid characters found in NameTx.Name (%s). Only alphanumeric, underscores, and forward slashes allowed",tx.Name))
returnErrTxInvalidString{Fmt("Invalid characters found in NameTx.Name (%s). Only alphanumeric, underscores, dashes, forward slashes, and @ are allowed",tx.Name)}
}
if!validateNameRegEntryData(tx.Data){
returnerrors.New(Fmt("Invalid characters found in NameTx.Data (%s). Only the kind of things found in a JSON file are allowed",tx.Data))
returnErrTxInvalidString{Fmt("Invalid characters found in NameTx.Data (%s). Only the kind of things found in a JSON file are allowed",tx.Data)}