flow-go-sdk
flow-go-sdk copied to clipboard
Got multiple errors when calling "GetTransactionResult" on specific transactions
Problem
Got multiple errors when calling GetTransactionResult on specific transactions.
Is this the problem of the SDK or just these transactions are malformatted?
Steps to Reproduce
Dependencies
github.com/onflow/cadence v0.24.3
github.com/onflow/flow-go-sdk v0.26.2
Code snippet

Transaction IDs:
32c2772893e964c104cf53c6c7c69032810911a44a8209a47709e307ccc09aaa
5b6edfa55411371fa1e2f7482aab7c96ff893a90e88f6185cabe0a95d85c2c8a
844466e504b25aace26cfd775ccdbacffe2aba395aa1a1809bc7836d34d6db07
b8c4c11fc2174ba3da2a952f882174fa30f5bb7cf920bfc156422d1e23166813
99157b3a440f924b09815c9c608e297efcb2e82347a13a630700890320b05cf8
e8f3bfa4a7c19815e207583631159f71f44cb20f5191ee46a25d1f5f3e200708
GetTransactionResult returned the below error:
client: failed to construct flow.TransactionResult entity from protobuf value: convert: failed to decode value: invalid JSON Cadence structure
Acceptance Criteria
Either a fix to the SDK or we are safe to skip these specific transactions (aka. they are malformatted)
Context
We are trying to all events from the transactions and this error blocked the process.
Additional Info
Full grpc response:
error: mismatched types
--> 058ab2d5d9808702.BLUES:125:20
|
125 | return &self.ownedNFTs[id] as &NonFungibleToken.NFT
| ^^^^^^^^^^^^^^^^^^ expected `NonFungibleToken.NFT`, got `NonFungibleToken.NFT?`
error: mismatched types
--> 058ab2d5d9808702.BLUES:130:23
|
130 | let ref = &self.ownedNFTs[id] as auth &NonFungibleToken.NFT
| ^^^^^^^^^^^^^^^^^^ expected `NonFungibleToken.NFT`, got `NonFungibleToken.NFT?`
error: mismatched types
--> 058ab2d5d9808702.BLUES:148:23
|
148 | let nft = &self.ownedNFTs[id] as auth &NonFungibleToken.NFT
| ^^^^^^^^^^^^^^^^^^ expected `NonFungibleToken.NFT`, got `NonFungibleToken.NFT?`
error: mismatched types
--> 058ab2d5d9808702.BLUES:158:27
|
158 | let ref = &self.ownedNFTs[id] as auth &NonFungibleToken.NFT
| ^^^^^^^^^^^^^^^^^^ expected `NonFungibleToken.NFT`, got `NonFungibleToken.NFT?`
error: cannot find variable in this scope: `BLUES`
--> c60b220b9473c4f3215dea325cf945bd50de9e7d94e7a56aa28489c011005c03:8:42
|
8 | let collection <- BLUES.createEmptyCollection()
| ^^^^^ not found in this scope
error: cannot find type in this scope: `BLUES`
--> c60b220b9473c4f3215dea325cf945bd50de9e7d94e7a56aa28489c011005c03:11:35
|
11 | acct.save<@BLUES.Collection>(<-collection, to: /storage/BLUESCollection)
| ^^^^^ not found in this scope
error: cannot find type in this scope: `BLUES`
--> c60b220b9473c4f3215dea325cf945bd50de9e7d94e7a56aa28489c011005c03:17:35
|
17 | acct.link<&BLUES.Collection{NonFungibleToken.CollectionPublic, BLUES.BLUESCollectionPublic}>(BLUES.CollectionPublicPath, target: BLUES.CollectionStoragePath)
| ^^^^^ not found in this scope
error: cannot find type in this scope: `BLUES`
--> c60b220b9473c4f3215dea325cf945bd50de9e7d94e7a56aa28489c011005c03:17:87
|
17 | acct.link<&BLUES.Collection{NonFungibleToken.CollectionPublic, BLUES.BLUESCollectionPublic}>(BLUES.CollectionPublicPath, target: BLUES.CollectionStoragePath)
| ^^^^^ not found in this scope
error: cannot find variable in this scope: `BLUES`
--> c60b220b9473c4f3215dea325cf945bd50de9e7d94e7a56aa28489c011005c03:17:117
|
17 | acct.link<&BLUES.Collection{NonFungibleToken.CollectionPublic, BLUES.BLUESCollectionPublic}>(BLUES.CollectionPublicPath, target: BLUES.CollectionStoragePath)
| ^^^^^ not found in this scope
error: cannot find variable in this scope: `BLUES`
--> c60b220b9473c4f3215dea325cf945bd50de9e7d94e7a56aa28489c011005c03:17:153
|
17 | acct.link<&BLUES.Collection{NonFungibleToken.CollectionPublic, BLUES.BLUESCollectionPublic}>(BLUES.CollectionPublicPath, target: BLUES.CollectionStoragePath)
| ^^^^^ not found in this scope
error: cannot infer type parameter: `T`
--> c60b220b9473c4f3215dea325cf945bd50de9e7d94e7a56aa28489c011005c03:17:24
|
17 | acct.link<&BLUES.Collection{NonFungibleToken.CollectionPublic, BLUES.BLUESCollectionPublic}>(BLUES.CollectionPublicPath, target: BLUES.CollectionStoragePath)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@kilru have you been experiencing this still? I believe the https://github.com/onflow/flow-go-sdk/releases/tag/v0.26.4 should fix this.