Skip to content

Commit

Permalink
Removed punctuation changes from this branch
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmus-kirk committed Sep 18, 2024
1 parent db29f9a commit d5ef5e7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
`transaction add-signature`.)
- Add optional `--out` flag to all transaction-creating commands to output a partially-singed
transaction to a file.
- Update GHC version to 9.6.4 (lts-22.9).
- Update Rust version to 1.73.
- Preliminary support for protocol version 7.

## 6.2.1

Expand Down
17 changes: 8 additions & 9 deletions src/Concordium/Client/Output.hs
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,7 @@ showOutcomeResult verbose contrInfoWithEventsM = \case
Types.Resumed{} -> (idt - 4, idt - 4)
_ -> (idt, idt)

evStringM = fmap (indentBy idtCurrent . prettyMsg ".") (showEvent verbose cInfo ev)

evStringM = fmap (indentBy idtCurrent) (showEvent verbose cInfo ev)
in
(idtFollowing, out <> [evStringM])

Expand Down Expand Up @@ -794,11 +793,11 @@ showEvent verbose ciM = \case
Types.ContractInitialized{..} ->
verboseOrNothing $
[i|initialized contract '#{ecAddress}' using init function '#{ecInitName}' from module '#{ecRef}' |]
<> [i|with #{showCcd ecAmount}.\n#{showLoggedEvents ecEvents}|]
<> [i|with #{showCcd ecAmount}\n#{showLoggedEvents ecEvents}|]
Types.Updated{..} ->
verboseOrNothing $
[i|sent message to function '#{euReceiveName}' with #{showParameter euReceiveName euMessage} and #{showCcd euAmount} |]
<> [i|from #{showAddress euInstigator} to #{showAddress $ Types.AddressContract euAddress}.\n|]
<> [i|from #{showAddress euInstigator} to #{showAddress $ Types.AddressContract euAddress}\n|]
<> [i|#{showLoggedEvents euEvents}|]
Types.Transferred{..} ->
verboseOrNothing $ printf "transferred %s from %s to %s" (showCcd etAmount) (showAddress etFrom) (showAddress etTo)
Expand All @@ -807,7 +806,7 @@ showEvent verbose ciM = \case
Types.CredentialDeployed{..} ->
verboseOrNothing $ printf "credential with registration '%s' deployed onto account '%s'" (show ecdRegId) (show ecdAccount)
Types.BakerAdded{..} ->
let restakeString :: String = if ebaRestakeEarnings then "Earnings are added to the stake" else "Earnings are not added to the stake"
let restakeString :: String = if ebaRestakeEarnings then "Earnings are added to the stake." else "Earnings are not added to the stake."
in verboseOrNothing $ printf "validator %s added, staking %s CCD. %s" (showBaker ebaBakerId ebaAccount) (Types.amountToString ebaStake) restakeString
Types.BakerRemoved{..} ->
verboseOrNothing $ printf "validator %s, removed" (showBaker ebrBakerId ebrAccount)
Expand Down Expand Up @@ -856,7 +855,7 @@ showEvent verbose ciM = \case
verboseOrNothing [i|Registered data on chain.|]
Types.TransferMemo{..} ->
let (Types.Memo bss) = tmMemo
invalidCBOR = printf "Could not decode memo as valid CBOR. The hex value of the memo is %s" $ show tmMemo
invalidCBOR = printf "Could not decode memo as valid CBOR. The hex value of the memo is %s." $ show tmMemo
bsl = BSL.fromStrict $ BSS.fromShort bss
str = case deserialiseFromBytes decodeString bsl of -- Try to decode the memo as a CBOR string
Left _ -> json -- if not possible, try to decode as JSON
Expand All @@ -874,10 +873,10 @@ showEvent verbose ciM = \case
Types.Interrupted cAddr ev ->
verboseOrNothing [i|interrupted '#{cAddr}'.\n#{showLoggedEvents ev}|]
Types.Upgraded{..} ->
verboseOrNothing [i|upgraded contract instance at '#{euAddress}' from '#{euFrom}' to '#{euTo}'|]
verboseOrNothing [i|upgraded contract instance at '#{euAddress}' from '#{euFrom}' to '#{euTo}'.|]
Types.Resumed cAddr invokeSucceeded ->
let invokeMsg :: Text = if invokeSucceeded then "succeeded" else "failed"
in verboseOrNothing [i|resumed '#{cAddr}' after an interruption that #{invokeMsg}|]
in verboseOrNothing [i|resumed '#{cAddr}' after an interruption that #{invokeMsg}.|]
where
verboseOrNothing :: String -> Maybe String
verboseOrNothing msg = if verbose then Just msg else Nothing
Expand Down Expand Up @@ -910,7 +909,7 @@ showEvent verbose ciM = \case

-- Show events logged in a contract.
showLoggedEvents :: [Wasm.ContractEvent] -> String
showLoggedEvents [] = "No contract events were emitted"
showLoggedEvents [] = "No contract events were emitted."
showLoggedEvents evs =
[i|#{length evs} contract #{if length evs > 1 then "events were" else ("event was" :: String)} emitted|]
<> ( if isNothing eventSchemaM
Expand Down
8 changes: 4 additions & 4 deletions test/SimpleClientTests/TransactionSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -285,16 +285,16 @@ printTransactionStatusTests = describe "print transaction status" $ do
p committedTwoDifferentSuccessfulOutcomes
`shouldBe` [ "Transaction is committed into 2 blocks:",
"- 0a5d64f644461d95315a781475b83f723f74d1c21542bd4f3e234d6173374389 with status \"success\" and cost 0.000010 CCD (10 NRG):",
" * Transferred 0.000010 CCD from account '2zR4h351M1bqhrL9UywsbHrP3ucA1xY3TBTFRuTsRout8JnLD6' to account '4MkK65HrYvMauNTHTuL23wRDKp4VXkCiTpmoWYFtsrZHV3WwSa'.",
" * transferred 0.000010 CCD from account '2zR4h351M1bqhrL9UywsbHrP3ucA1xY3TBTFRuTsRout8JnLD6' to account '4MkK65HrYvMauNTHTuL23wRDKp4VXkCiTpmoWYFtsrZHV3WwSa'",
"- 941c24374cd077de2120fb58732306c3115a08bb7b7cda120a04fecc412b1795 with status \"success\" and cost 0.000020 CCD (20 NRG):",
" * Transferred 0.000010 CCD from account '2zR4h351M1bqhrL9UywsbHrP3ucA1xY3TBTFRuTsRout8JnLD6' to account '4MkK65HrYvMauNTHTuL23wRDKp4VXkCiTpmoWYFtsrZHV3WwSa'."
" * transferred 0.000010 CCD from account '2zR4h351M1bqhrL9UywsbHrP3ucA1xY3TBTFRuTsRout8JnLD6' to account '4MkK65HrYvMauNTHTuL23wRDKp4VXkCiTpmoWYFtsrZHV3WwSa'"
]
describe "committed into two blocks" $
specify "correct output" $
p committedSuccessfulAndFailureOutcomes
`shouldBe` [ "Transaction is committed into 2 blocks:",
"- 0a5d64f644461d95315a781475b83f723f74d1c21542bd4f3e234d6173374389 with status \"success\" and cost 0.000010 CCD (10 NRG):",
" * Transferred 0.000010 CCD from account '2zR4h351M1bqhrL9UywsbHrP3ucA1xY3TBTFRuTsRout8JnLD6' to account '4MkK65HrYvMauNTHTuL23wRDKp4VXkCiTpmoWYFtsrZHV3WwSa'.",
" * transferred 0.000010 CCD from account '2zR4h351M1bqhrL9UywsbHrP3ucA1xY3TBTFRuTsRout8JnLD6' to account '4MkK65HrYvMauNTHTuL23wRDKp4VXkCiTpmoWYFtsrZHV3WwSa'",
"- be880f81dfbcc0a049c3defe483327d0a2a3002a186a06d34bcd93a9be7f9994 with status \"rejected\" and cost 0.000020 CCD (20 NRG):",
" * account or contract '2zR4h351M1bqhrL9UywsbHrP3ucA1xY3TBTFRuTsRout8JnLD6' does not have enough funds to transfer 0.000011 CCD"
]
Expand All @@ -303,7 +303,7 @@ printTransactionStatusTests = describe "print transaction status" $ do
p committedSuccessfulAndFailureOutcomes
`shouldBe` [ "Transaction is committed into 2 blocks:",
"- 0a5d64f644461d95315a781475b83f723f74d1c21542bd4f3e234d6173374389 with status \"success\" and cost 0.000010 CCD (10 NRG):",
" * Transferred 0.000010 CCD from account '2zR4h351M1bqhrL9UywsbHrP3ucA1xY3TBTFRuTsRout8JnLD6' to account '4MkK65HrYvMauNTHTuL23wRDKp4VXkCiTpmoWYFtsrZHV3WwSa'.",
" * transferred 0.000010 CCD from account '2zR4h351M1bqhrL9UywsbHrP3ucA1xY3TBTFRuTsRout8JnLD6' to account '4MkK65HrYvMauNTHTuL23wRDKp4VXkCiTpmoWYFtsrZHV3WwSa'",
"- be880f81dfbcc0a049c3defe483327d0a2a3002a186a06d34bcd93a9be7f9994 with status \"rejected\" and cost 0.000020 CCD (20 NRG):",
" * account or contract '2zR4h351M1bqhrL9UywsbHrP3ucA1xY3TBTFRuTsRout8JnLD6' does not have enough funds to transfer 0.000011 CCD"
]
Expand Down

0 comments on commit d5ef5e7

Please sign in to comment.