engine icon indicating copy to clipboard operation
engine copied to clipboard

Issue with encoding of a process in the LCD

Open antho1404 opened this issue 4 years ago • 1 comments

There are issues with the encoding of the process. This can come from different places:

  • amino/lcd API: most likely as a process deployed with GRPC will have a different encoding when read from the LCD with /process/get/xxxx
  • CLI
  • compiler
name: Test
steps:
  - type: trigger
    instance: 
      src: https://github.com/mesg-foundation/service-js-function
    taskKey: execute
  - type: filter
    conditions:
      result: hello
  - type: task
    instance: 
      src: https://github.com/mesg-foundation/service-js-function
    taskKey: execute
    inputs:
      code: "module.export = value => true"
      inputs:
        foo: 42
// with GRPC
{"type":"process/CreateProcess","value":{"address":"mesgtest1jyagmc00ev2undv8zeuuyfsj6vsf027jdyu3y0","request":{"edges":[{"dst":"node-1","src":"node-0"},{"dst":"node-2-inputs","src":"node-1"},{"dst":"node-2","src":"node-2-inputs"}],"name":"Test","nodes":[{"Type":{"type":"mesg.types.Process_Node_Result_","value":{"result":{"instanceHash":"E6Hh1tKL3pi1bi7iL3FH6y1Um1vHfCoo8qZfGVFfm9pp","taskKey":"execute"}}},"key":"node-0"},{"Type":{"type":"mesg.types.Process_Node_Filter_","value":{"filter":{"conditions":[{"key":"result","predicate":1,"value":"hello"}]}}},"key":"node-1"},{"Type":{"type":"mesg.types.Process_Node_Map_","value":{"map":[{"Key":"code","Value":{"Value":{"type":"mesg.types.Process_Node_Map_Output_StringConst","value":{"string_const":"module.export = value => true"}}}},{"Key":"inputs","Value":{"Value":{"type":"mesg.types.Process_Node_Map_Output_Map_","value":{"map":[{"Key":"foo","Value":{"Value":{"type":"mesg.types.Process_Node_Map_Output_DoubleConst","value":{"double_const":42}}}}]}}}}]}},"key":"node-2-inputs"},{"Type":{"type":"mesg.types.Process_Node_Task_","value":{"task":{"instanceHash":"E6Hh1tKL3pi1bi7iL3FH6y1Um1vHfCoo8qZfGVFfm9pp","taskKey":"execute"}}},"key":"node-2"}]}}}

// With LCD
{"type":"process/CreateProcess","value":{"address":"mesgtest1jyagmc00ev2undv8zeuuyfsj6vsf027jdyu3y0","request":{"edges":[{"dst":"node-1","src":"node-0"},{"dst":"node-2-inputs","src":"node-1"},{"dst":"node-2","src":"node-2-inputs"}],"name":"Test","nodes":[{"Type":{"type":"mesg.types.Process_Node_Result_","value":{"result":{"instanceHash":"E6Hh1tKL3pi1bi7iL3FH6y1Um1vHfCoo8qZfGVFfm9pp","taskKey":"execute"}}},"key":"node-0"},{"Type":{"type":"mesg.types.Process_Node_Filter_","value":{"filter":{"conditions":[{"key":"result","predicate":1,"value":"hello"}]}}},"key":"node-1"},{"Type":{"type":"mesg.types.Process_Node_Map_","value":{"map":[{"Key":"code","Value":{"Value":{"type":"mesg.types.Process_Node_Map_Output_StringConst","value":{"string_const":"module.export = value =\u003e true"}}}},{"Key":"inputs","Value":{"Value":{"type":"mesg.types.Process_Node_Map_Output_Map_","value":{"map":[{"Key":"foo","Value":{"Value":{"type":"mesg.types.Process_Node_Map_Output_DoubleConst","value":{"double_const":42}}}}]}}}}]}},"key":"node-2-inputs"},{"Type":{"type":"mesg.types.Process_Node_Task_","value":{"task":{"instanceHash":"E6Hh1tKL3pi1bi7iL3FH6y1Um1vHfCoo8qZfGVFfm9pp","taskKey":"execute"}}},"key":"node-2"}]}}}

The diff is on the argument for the function

{"string_const":"module.export = value => true"}
// vs
{"string_const":"module.export = value =\u003e true"}

antho1404 avatar Mar 17 '20 06:03 antho1404

related to https://github.com/mesg-foundation/engine/issues/1681 and https://github.com/mesg-foundation/engine/issues/1673

NicolasMahe avatar Mar 17 '20 07:03 NicolasMahe