Skip to content

Transfer transaction returns Malformed Request Error #45

@bobbyharsono

Description

@bobbyharsono

i am trying to run sample 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions