bigchaindb/go-bigchaindb-driver

400 Bad Request response

BingjieGao opened this issue · 5 comments

using Testnet with simple e2e test and encountering 400 Bad Request always, The error message shows: "Invalid transaction (InvalidSignature): Fulfillment URI couldn't been parsed"

Here is the generated txn:

{
   "asset":{
      "data":{
         "assetID":"testID1"
      }
   },
   "id":"5e6e46426dce887a4a290a70bac2abac0f7a9d9e58ee7fc0af02b61e2a386388",
   "inputs":[
      {
         "fulfillment":"39U7KAJxeTp39xSTbFsAa9pxR2LguKbgsPcoMmgzxuianXNVLwYRVHdTQF1Es9WDJWNEJT2zW3CdSutHqPRWRBzVVAUHMzBZAjaay3bvfa8s9YVA2Bt9FKj2F9o5CR6GNn6nv3cuYX9D",
         "fulfills":null,
         "owners_before":[
            "EbWsA7xfNhHuAxqfPUPKZ6ScxNxoramt3dufYedDsh7F"
         ]
      }
   ],
   "metadata":{
      "planet":"earth"
   },
   "operation":"CREATE",
   "outputs":[
      {
         "amount":"1",
         "condition":{
            "details":{
               "public_key":"EbWsA7xfNhHuAxqfPUPKZ6ScxNxoramt3dufYedDsh7F",
               "type":"ed25519-sha-256"
            },
            "uri":"ni:///sha-256;yf9yHbEN_bhiRmhdibzH9UQBGF7ZK5ZY71aghixhPNo?fpt=ed25519-sha-256&cost=131072"
         },
         "public_keys":[
            "EbWsA7xfNhHuAxqfPUPKZ6ScxNxoramt3dufYedDsh7F"
         ]
      }
   ],
   "version":"2.0"
}
ttmc commented

Hi @BingjieGao --- We know that the Go driver isn't 100% working yet, but we haven't figured out how to fix it yet.

@BingjieGao thanks for listing the issue and trying out the driver; as @ttmc mentions, the driver is still a work in progress. The error you are getting is because the BDB server creates a different fullfilment URI from the driver. The go-interledger package that the go driver use seems to calculate it different from the python implementation that the bigchaindb server uses.

have fixed it? I had the same err!

#6
Please see my pull request. I believe I have solved the problem.
I am new to doing pull request on github so let me know if I am missing anything.
Thanks.
Philip Kwan

We are facing the same issue. When calling from client, returns 400 but from postman we get the error Invalid transaction (InvalidSignature): Fulfillment URI couldn't been parsed.