Skip to content

Commit

Permalink
[#131] Disable getTokenMetadata command and test
Browse files Browse the repository at this point in the history
  • Loading branch information
sras committed Dec 25, 2020
1 parent 05e7ae7 commit 93a41df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
11 changes: 7 additions & 4 deletions haskell/nettest/StablecoinClientTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Stablecoin.Client
import Stablecoin.Client.Cleveland
(StablecoinScenario, acceptOwnership, assertEq, burn, changeMasterMinter, changePauser,
configureMinter, deploy, getBalanceOf, getContractOwner, getMasterMinter, getMintingAllowance,
getPaused, getPauser, getPendingContractOwner, getTokenMetadata, getTransferlist, isOperator,
getPaused, getPauser, getPendingContractOwner, getTransferlist, isOperator,
mint, pause, removeMinter, revealKeyUnlessRevealed, setTransferlist, transferOwnership, unpause,
updateOperators)
import qualified Stablecoin.Client.Cleveland as SC
Expand Down Expand Up @@ -112,9 +112,12 @@ stablecoinClientScenario = do
po `assertEq` Just (AddressAndAlias pauserAddr (Just pauserAlias))
acceptOwnership (#sender .! pauser) contract

comment "Testing token metadata"
getTokenMetadata contract >>= \tm ->
tm `assertEq` (#symbol .! "a", #name .! "b", #decimals .! 3)
-- TODO @SRAS Commenting the following out as it is not clear how to implement
-- it when the token metadata is exposed as a storage view.
--
-- comment "Testing token metadata"
-- getTokenMetadata contract >>= \tm ->
-- tm `assertEq` (#symbol .! "a", #name .! "b", #decimals .! 3)

where
createRole :: AliasHint -> StablecoinScenario m (Alias, Address, AddressOrAlias)
Expand Down
12 changes: 6 additions & 6 deletions haskell/src/Stablecoin/Client/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ import qualified Options.Applicative as Opt
import Util.Exception (displayUncaughtException)
import Util.Named ((.!))

import Lorentz.Contracts.Spec.FA2Interface (TokenMetadata(..))
import Stablecoin.Client.Contract (InitialStorageData(..))
import Stablecoin.Client.Impl
(AddressAndAlias(..), acceptOwnership, burn, changeMasterMinter, changePauser, configureMinter,
deploy, getBalance, getBalanceOf, getContractOwner, getMasterMinter, getMintingAllowance,
getPaused, getPauser, getPendingContractOwner, getTokenMetadata, getTransferlist, isOperator,
getPaused, getPauser, getPendingContractOwner, getTransferlist, isOperator,
mint, pause, removeMinter, setTransferlist, transfer, transferOwnership, unpause,
updateOperators)
import Stablecoin.Client.Parser
Expand Down Expand Up @@ -165,10 +164,11 @@ mainProgram (ClientArgs _ globalOptions cmd) = do
putTextLn $ "Minting allowance: " <> pretty allowance

CmdGetTokenMetadata -> do
tm <- getTokenMetadata contract
putTextLn $ "Token symbol: " <> pretty (tmSymbol tm)
putTextLn $ "Token name: " <> pretty (tmName tm)
putTextLn $ "Token decimals: " <> pretty (tmDecimals tm)
putTextLn "This command is not available now"
-- tm <- getTokenMetadata contract
-- putTextLn $ "Token symbol: " <> pretty (tmSymbol tm)
-- putTextLn $ "Token name: " <> pretty (tmName tm)
-- putTextLn $ "Token decimals: " <> pretty (tmDecimals tm)

where
user = #sender .! goUser globalOptions
Expand Down

0 comments on commit 93a41df

Please sign in to comment.