Weird bug setting variant in proposal

It’s not single or double quotes:

PAYLOAD=$(didc encode "$ARGS" --format blob -d \"./dfx/canisters/OpenFPL_backend/OpenFPL_Backend.did\" -m $METHOD)

No quote, it’s just a regular argument. The path is relative to the bash script. You can pass in an absolute path if it’s confusing.

PAYLOAD=$(didc encode "$ARGS" --format blob -d ../../.dfx/canisters/OpenFPL_backend/OpenFPL_Backend.did -m $METHOD)
1 Like

I still get an error:

Caused by:
Unrecognized token RBrace found at 251:252
Expected one of “(”, “blob”, “bool”, “decimal”, “float”, “func”, “hex”, “null”, “opt”, “principal”, “record”, “service”, “sign”, “text”, “variant” or “vec”
Error: Invalid JSON content

I tried submitting:


./make_custom_function_proposal.sh $FUNCTION_ID "$TITLE" "$SUMMARY" "$URL" "$ARGS" "executeSubmitFixtureData"

with this added in the proposal file:

PAYLOAD=$(didc encode "$ARGS" --format blob -d ../../.dfx/canisters/OpenFPL_backend/OpenFPL_Backend.did -m $METHOD)

I echode the proposal before submission


# Candid encode the payload as binary
PAYLOAD=$(didc encode "$ARGS" --format blob -d ../../.dfx/canisters/OpenFPL_backend/OpenFPL_Backend.did -m $METHOD)



# Build the proposal candid
PROPOSAL="(record { title=\"$TITLE\"; url=\"$URL\"; summary=\"$SUMMARY\"; action=opt variant {ExecuteGenericNervousSystemFunction = record {function_id=($FUNCTION_ID:nat64); payload=$PAYLOAD}}})"
echo $PROPOSAL
# Make the proposal
./submit_proposal.sh "$PROPOSAL"

and it outputted:

If you could let me know how I add the arguments to raise the proposal that would be great.

Tried method without quotes too


./make_custom_function_proposal.sh $FUNCTION_ID "$TITLE" "$SUMMARY" "$URL" "$ARGS" executeSubmitFixtureData

Same error:

Ok I was able to pass it in i just had the wrong file path and my proposal values are correct locally!

Thanks @chenyan