bigchaindb / bigchaindb/java-bigchaindb-driver

Transfer transaction returns Malformed Request Error

Open
#45 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
29
Forks
30
PR merge metrics
No merged PRs in 30d

Description

i am trying to run sample [https://gist.github.com/innoprenuer/d4c6798fe5c0581c05a7e676e175e515](https://gist.github.com/innoprenuer/d4c6798fe5c0581c05a7e676e175e515)

The asset creation working fine, however when i transferred asset, it returns
malformed BAD REQUEST
Transaction failed

I am unable to query (via HTTP API) the transaction ID as well, it throws 404 not found error;

**Update:**
It turns out, if i use BigchainDbTransactionBuilder like below,
`Transaction transferTransaction = BigchainDbTransactionBuilder
.init()
.operation(Operations.TRANSFER)
.addInput("FULLFILLMENT", spendFrom, (EdDSAPublicKey) alice.getPublic())
.addOutput("1", (EdDSAPublicKey) robert.getPublic())
.addAssets(aliceRegisterTx.getAsset().getData(), TreeMap.class)
.addMetaData(transferMetadata)
.buildAndSign((EdDSAPublicKey) alice.getPublic(), (EdDSAPrivateKey) alice.getPrivate())
.sendTransaction(handleServerResponse());`

I notice that operation type is not detected, hence making it populated by default (CREATE), however i tried to create a manual version of transaction building (not using builder a.k.a copy paste the code in builder class) the output was set correctly (TRANSFER) but the main problem still linger.

I compared the json output after send transaction, and no invalid structure spotted

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.