Skip to content

Commit da66603

Browse files
committed
adding underscore in vanity
1 parent 4cb2573 commit da66603

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

contracts/VanityURL.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ contract VanityURL is Ownable,Pausable {
207207
require(length >= 4 && length <= 200);
208208
for (uint i =0; i< length; i++){
209209
var c = bytes(_vanity_url)[i];
210-
if (c < 48 || c > 122 || (c > 57 && c < 65) || (c > 90 && c < 97 ) )
210+
if ((c < 48 || c > 122 || (c > 57 && c < 65) || (c > 90 && c < 97 )) && (c != 95))
211211
return false;
212212
}
213213
return true;

test/2_vanity.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ contract('VanityURL', function(accounts) {
5656
return tokenInstance.balanceOf.call(account_two);
5757
}).then(function(balance){
5858
account_two_starting_balance = balance.toNumber();
59-
return vanityInstance.reserve('vinay035',{from:accounts[1]});
59+
return vanityInstance.reserve('vinay_035',{from:accounts[1]});
6060
}).then(function(instance){
61-
return vanityInstance.retrieveWalletForVanity.call('vinay035');
61+
return vanityInstance.retrieveWalletForVanity.call('vinay_035');
6262
}).then(function(result) {
6363
assert.equal(result,accounts[1],"Should be able to retrive the same wallet address");
6464
return vanityInstance.retrieveVanityForWallet.call(accounts[1]);
6565
}).then(function(result) {
66-
assert.equal(result,'vinay035',"Should be able to retrive the same vanity");
66+
assert.equal(result,'vinay_035',"Should be able to retrive the same vanity");
6767
}).then(function() {
6868
return tokenInstance.balanceOf.call(account_one);
6969
}).then(function(balance) {
@@ -117,12 +117,12 @@ contract('VanityURL', function(accounts) {
117117

118118
it("should be able to transfer a vanity", function() {
119119
return vanityInstance.transferOwnershipForVanityURL(accounts[3],{from:accounts[1]}).then(function(instance){
120-
return vanityInstance.retrieveWalletForVanity.call('vinay035');
120+
return vanityInstance.retrieveWalletForVanity.call('vinay_035');
121121
}).then(function(result) {
122122
assert.equal(result,accounts[3],"Should be able to retrive the same wallet address");
123123
return vanityInstance.retrieveVanityForWallet.call(accounts[3]);
124124
}).then(function(result) {
125-
assert.equal(result,'vinay035',"Should be able to retrive the same vanity");
125+
assert.equal(result,'vinay_035',"Should be able to retrive the same vanity");
126126
}).catch(function(error){
127127
assert.isUndefined(error,"should be able to reserve a url")
128128
})

0 commit comments

Comments
 (0)