-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nameservice interact #168
Nameservice interact #168
Conversation
+Fix markdown-unlit issue
-------------------------------------------------------------------------------- | ||
|
||
genNames :: Int -> IO [Name] | ||
genNames 0 = return [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
genNames = replicateM (fmap fromString genName)
names <- genNames (x - 1) | ||
return (aName:names) | ||
|
||
genVals :: Int -> IO [Text] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
genVals = replicateM (fmap cs Lorem.word)
createName :: User -> Name -> Text -> IO () | ||
createName user name val = buyName user name val 0 | ||
|
||
createNames :: User -> [(Name, Text)] -> IO () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createNames user = mapM_ (uncurry . createName user)
rawTx = mkSignedRawTransactionWithRoute "nameservice" userPrivKey msg | ||
in runTransaction_ rawTx | ||
|
||
buyNames :: User -> [(Name, Text, Amount)] -> IO () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buyNames user = mapM_ (uncurry . buyName user)
rawTx = mkSignedRawTransactionWithRoute "nameservice" userPrivKey msg | ||
in runTransaction_ rawTx | ||
|
||
deleteNames :: User -> [Name] -> IO () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createNames user = mapM_ (uncurry . deleteName user)
|
||
setNames :: User -> [(Name, Text)] -> IO () | ||
setNames _ [] = return () | ||
setNames user ((name, val):rst) = do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createNames user = mapM_ (uncurry . setName user)
mConc <- lookupEnv "TX_COUNT" | ||
let conc = maybe 1 read mConc | ||
putStrLn $ "Running nameservice interaction w/ TX_COUNT: " <> show conc | ||
faucetAccount user1 10000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should faucet inside the loop
|
||
main :: IO () | ||
main = do | ||
mConc <- lookupEnv "TX_COUNT" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is mConc? use a variable name that's more transparent
Closes #157