-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
Instructions
I am trying to parse the output of flow-cli`s -o json flag into a cadence transaction using cadence go dependency. This used to work, but now it does not work anymore
Problem
flow transactions get c82243bb504e49a0bd55191d8a7b6001ef391ce6fa5e69f580e2e3ca8524372e -n mainnet -o json | ./overflow-json
this does not work where code is
package main
import (
"fmt"
"io"
"os"
"github.com/bjartek/underflow"
jsoncdc "github.com/onflow/cadence/encoding/json"
)
func main() {
_, err := os.Stdin.Stat()
if err != nil {
panic(err)
}
bytes, err := io.ReadAll(os.Stdin)
if err != nil {
panic(err)
}
value, err := jsoncdc.Decode(nil, bytes)
if err != nil {
panic(err)
}
output, err := underflow.CadenceValueToJsonString(value)
if err != nil {
panic(err)
}
fmt.Println(output)
}
It fails on line 24, so before my code even runs.
Steps to Reproduce
Build the binary from the code above and try to run the cli command
Acceptance Criteria
It is possible to parse flow-cli transaction output into a in memory representation in golang.
Context
Debugging things
chasefleming
Metadata
Metadata
Assignees
Labels
No labels