File tree Expand file tree Collapse file tree 4 files changed +9
-5
lines changed Expand file tree Collapse file tree 4 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 5
5
toolchain go1.21.6
6
6
7
7
require (
8
- github.com/blinklabs-io/gouroboros v0.84 .0
8
+ github.com/blinklabs-io/gouroboros v0.85 .0
9
9
github.com/gen2brain/beeep v0.0.0-20230602101333-f384c29b62dd
10
10
github.com/gin-gonic/gin v1.10.0
11
11
github.com/kelseyhightower/envconfig v1.4.0
Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
4
4
filippo.io/edwards25519 v1.1.0 /go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4 =
5
5
github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc =
6
6
github.com/KyleBanks/depth v1.2.1 /go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE =
7
- github.com/blinklabs-io/gouroboros v0.84 .0 h1:uVKfYA4VBnrTle2mr85TpJNS1WkZTz31OOF0K4bJ1MU =
8
- github.com/blinklabs-io/gouroboros v0.84 .0 /go.mod h1:EZe1WcIWfZNESlwHPGLStB6HluXGTkf/ZFUbBi5bCvs =
7
+ github.com/blinklabs-io/gouroboros v0.85 .0 h1:KLB7prQpDq3IRIS7Oxl8cz8nABSjU8UoOp0TvBhSyAc =
8
+ github.com/blinklabs-io/gouroboros v0.85 .0 /go.mod h1:EZe1WcIWfZNESlwHPGLStB6HluXGTkf/ZFUbBi5bCvs =
9
9
github.com/blinklabs-io/ouroboros-mock v0.3.0 h1:6VRWyhAv0k7nQEgzFpuqhS/n8OM+OAaLN/sCT5K2Hbc =
10
10
github.com/blinklabs-io/ouroboros-mock v0.3.0 /go.mod h1:0dzTNEk/Kvqa7qYHDy7/Nn3OTt+EOosMknB37FRzI1k =
11
11
github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0 =
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ type TransactionEvent struct {
34
34
Inputs []ledger.TransactionInput `json:"inputs"`
35
35
Outputs []ledger.TransactionOutput `json:"outputs"`
36
36
Certificates []ledger.Certificate `json:"certificates"`
37
- Metadata * cbor.Value `json:"metadata,omitempty"`
37
+ Metadata * cbor.LazyValue `json:"metadata,omitempty"`
38
38
Fee uint64 `json:"fee"`
39
39
TTL uint64 `json:"ttl,omitempty"`
40
40
}
Original file line number Diff line number Diff line change @@ -298,11 +298,15 @@ func (p *PushOutput) OutputChan() <-chan event.Event {
298
298
// This should probably go in gouroboros module
299
299
// extractCIP20FromMetadata extracts the CIP20 message from the transaction metadata
300
300
// and returns it as a JSON string.
301
- func extractCIP20FromMetadata (metadata * cbor.Value ) (string , error ) {
301
+ func extractCIP20FromMetadata (metadata * cbor.LazyValue ) (string , error ) {
302
302
if metadata == nil {
303
303
return "" , fmt .Errorf ("metadata is nil" )
304
304
}
305
305
306
+ if _ , err := metadata .Decode (); err != nil {
307
+ return "" , fmt .Errorf ("could not decode metadata: %w" , err )
308
+ }
309
+
306
310
metadataMap , ok := metadata .Value ().(map [any ]any )
307
311
if ! ok {
308
312
return "" , fmt .Errorf ("metadata value is not of the expected map type" )
You can’t perform that action at this time.
0 commit comments