bigchaindb / go-bigchaindb-driver

Official Go BigchainDB driver
Apache License 2.0
11 stars 13 forks source link

400 Bad Request response #2

Open BingjieGao opened 6 years ago

BingjieGao commented 6 years ago

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 6 years ago

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

jellevdp commented 6 years ago

@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.

hduwyj commented 5 years ago

have fixed it? I had the same err!

pckwan commented 5 years ago

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

mukulrevelin commented 4 years ago

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.