From 7c30e44dc9d4d9ff74709dbf5acb17e9d0802da8 Mon Sep 17 00:00:00 2001 From: theoreticalbts Date: Mon, 6 Jul 2015 12:40:57 -0400 Subject: [PATCH] Fix is_valid_name() bugs, make it RFC 1035 compliant, update unit test, fix #15 --- libraries/chain/operations.cpp | 122 ++++++++++++++++++++++----------- tests/tests/basic_tests.cpp | 45 ++++++------ 2 files changed, 105 insertions(+), 62 deletions(-) diff --git a/libraries/chain/operations.cpp b/libraries/chain/operations.cpp index 1da28524..c274b6ed 100644 --- a/libraries/chain/operations.cpp +++ b/libraries/chain/operations.cpp @@ -63,58 +63,98 @@ bool is_valid_symbol( const string& symbol ) return true; } + + /** - * Valid names can contain [a, z], [0, 9], '.', and '-' - * They must start with [a, z] - * They must end with [a, z] or [0, 9] - * '.' must be followed by [a, z] - * '-' must be followed by [a, z] or [0, 9] + * Names must comply with the following grammar (RFC 1035): + * ::= | " " + * ::=