forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
assertIsBoardName()
function
Also changed the expression to validate board names to check that the name starts with three letters and ends with three numbers. This has been defined this way to match `users` realm implementation. See: gnolang#2827 In a next iteration we can support vanity names for boards, once vanity names are supported for the `users` realm.
- Loading branch information
1 parent
1510a6f
commit 3d0e592
Showing
2 changed files
with
14 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,13 @@ | ||
package boards | ||
|
||
import ( | ||
"regexp" | ||
|
||
"gno.land/p/demo/avl" | ||
) | ||
|
||
//---------------------------------------- | ||
// Realm (package) state | ||
|
||
// TODO: Create a Boards or App struct to handle counter and tree indexes | ||
var ( | ||
gBoards avl.Tree // id -> *Board | ||
gBoardsCtr int // increments Board.id | ||
gBoardsByName avl.Tree // name -> *Board | ||
gDefaultAnonFee = 100000000 // minimum fee required if anonymous | ||
) | ||
|
||
//---------------------------------------- | ||
// Constants | ||
|
||
var reName = regexp.MustCompile(`^[a-z]+[_a-z0-9]{2,29}$`) |