Skip to content
This repository was archived by the owner on Nov 6, 2021. It is now read-only.

Commit 75b6c92

Browse files
committed
Merged in dev (pull request #10)
MANTIS-23 fixed construction of NFT metadata, resolving #1
2 parents 5a04653 + 7c1957a commit 75b6c92

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

mantis.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cabal-version: >= 1.10
22

33
name : mantis
44
description : This tool provides several script-oriented utilities for the Cardano blockchain. In particular, it posts metadata or mints/burns tokens. It can also generate scripts, compute script addresses, compute the fingerprint of a token, and download scripts.
5-
version : 0.2.10.1
5+
version : 0.2.10.2
66
license : MIT
77
license-file : LICENSE
88
author : Brian W Bush

src/Mantis/Transaction.hs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ readMetadata' :: MonadIO m
116116
readMetadata' filename =
117117
do
118118
json <-
119-
foistMantisMaybeIO "Cound not decode metadata."
119+
foistMantisMaybeIO "Could not decode metadata."
120120
$ A.decodeFileStrict filename
121121
metadata <-
122122
foistMantisEither
@@ -211,8 +211,17 @@ readMinting :: MonadFail m
211211
-> MantisM m (A.Value, TxMetadata, Value)
212212
readMinting policyId filename =
213213
do
214-
(A.Object json, metadata) <- readMetadata' filename
214+
A.Object json <-
215+
foistMantisMaybeIO "Could not decode metadata."
216+
$ A.decodeFileStrict filename
215217
let
218+
json' =
219+
A.Object
220+
. H.singleton "721"
221+
. A.Object
222+
$ H.singleton
223+
(T.pack . BS.unpack $ serialiseToRawBytesHex policyId)
224+
(A.Object json)
216225
minting =
217226
valueFromList
218227
[
@@ -223,11 +232,7 @@ readMinting policyId filename =
223232
|
224233
name <- H.keys json
225234
]
226-
json' =
227-
A.Object
228-
. H.singleton "721"
229-
. A.Object
230-
$ H.singleton
231-
(T.pack . BS.unpack $ serialiseToRawBytesHex policyId)
232-
(A.Object json)
235+
metadata <-
236+
foistMantisEither
237+
$ metadataFromJson TxMetadataJsonNoSchema json'
233238
return (json', metadata, minting)

0 commit comments

Comments
 (0)