Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tz-jason opened this issue Jun 16, 2022 · 1 comment

Comments

@tz-jason
Copy link

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"
}
}
],

@qinheqing
Copy link

Is it solved? i have the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants