3

I am trying to return a value from an action as follows:

[[eosio::action("test2")]] int test2(int x)
{
  return x;
}

The code compiles correctly, and the ABI file shows the correct action return value data:

{
    "____comment": "This file was generated with eosio-abigen. DO NOT EDIT ",
    "version": "eosio::abi/1.2",
    "types": [],
    "structs": [
        {
            "name": "test2",
            "base": "",
            "fields": [
                {
                    "name": "x",
                    "type": "int32"
                }
            ]
        }
    ],
    "actions": [
        {
            "name": "test2",
            "type": "test2",
            "ricardian_contract": ""
        }
    ],
    "tables": [],
    "kv_tables": {},
    "ricardian_clauses": [],
    "variants": [],
    "action_results": [
        {
            "name": "test2",
            "result_type": "int32"
        }
    ]
}

However, when I try to set the contract, I get the error:

Error 3070003: Serialization Error Processing WASM
Error Details:
env.set_action_return_value unresolveable

I tried to activate the intrinsic protocol BUILTIN-ACTION_RETURN_VALUE when setting up the system contracts but I get the error message:

Error 3260000: Subjective exception thrown during block production
Error Details: protocol feature with digest '69b064c5178e2738e144ed6caa9349a3995370d78db29e494b3126ebd9111966' is unrecognized

Any ideas on what I'm doing wrong?

4

Can you call the below to activate ACTION_RETURN_VALUE

cleos push action eosio activate '["c3a6138c5061cf291310887c0b5c71fcaffeab90d5deb50d3b9e687cead45071"]'

It looks like you called activate with the description_digest and not the feature_digest.

curl -X POST http://localhost:8888/v1/producer/get_supported_protocol_features | jq -r
...
{                                                                                                                                      
    "feature_digest": "c3a6138c5061cf291310887c0b5c71fcaffeab90d5deb50d3b9e687cead45071",
    "subjective_restrictions": {
      "enabled": true,
      "preactivation_required": true,
      "earliest_allowed_activation_time": "1970-01-01T00:00:00.000"
    },
    "description_digest": "69b064c5178e2738e144ed6caa9349a3995370d78db29e494b3126ebd9111966",
    "dependencies": [],
    "protocol_feature_type": "builtin",
    "specification": [
      {
        "name": "builtin_feature_codename",
        "value": "ACTION_RETURN_VALUE"
      }
    ]
  }
...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.