Skip to content

getChunkDetails method will fail if transaction contains "CreateAccount" action #13

Description

@tz-jason

hello,
I use testnet for NearClientTest script testing, and the blockid = 92401255, shardid=3 as below, the execution failed because the transaction contains CreateAccount action.

failed message:
com.fasterxml.jackson.databind.exc.MismatchedInputException: Unexpected token (VALUE_STRING), expected START_OBJECT: need JSON Object to contain As.WRAPPER_OBJECT type information for class com.syntifi.near.api.rpc.model.transaction.Action
at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: com.syntifi.near.api.rpc.model.block.Chunk["transactions"]->java.util.ArrayList[1]->com.syntifi.near.api.rpc.model.transaction.Transaction["actions"]->java.util.ArrayList[0])

this is the script I called
**@test
void getChunkDetails_byBlockHeightAndShardId_chunk_notNull() throws JSONException, IOException {
try {
Chunk chunk = nearClient.getChunkDetails(92401255, 3);
assertNotNull(chunk);

        String inputJson = loadJsonFromResourceFile("json-test-samples/block-chunk/chunk-details.json");

        JSONAssert.assertEquals(getPrettyJson(chunk), inputJson, false);
    } catch (Exception e) {
        e.printStackTrace();
    }**

below is the actions list which near explore returns for this transaction, the CreateAccount is not like a action object( {"CreateAccount" : {}}), just shows string which jackson object can not deserialize it, how to solve it? thanks
"actions": [
"CreateAccount",
{
"Transfer": {
"deposit": "200000001000000000000000000"
}
},
{
"AddKey": {
"access_key": {
"nonce": 0,
"permission": "FullAccess"
},
"public_key": "ed25519:3bhUzp1Dmm1KcHRwKyswT7kFMsbrbf9Vn6vXFdsQ3Rxw"
}
}
],

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions