rchain / rchain-api

Obsoleted in favor of https://github.com/rchain-community/rchain-api. Use at your own risk.
Other
8 stars 4 forks source link

rhol`...` template tag #17

Closed dckc closed 6 years ago

dckc commented 6 years ago

fixes #16

JoshOrndorff commented 6 years ago

Moving the tests to json looks great. I don't understand the stuff about rhol template though. Tests do pass.

Should I merge?

dckc commented 6 years ago

I don't understand the stuff about rhol template though.

Then I guess this shouldn't merge until there are docs.

Any chance the standard MDN docs on Tagged templates do it for you?

JoshOrndorff commented 6 years ago

@dckc I've read and understood the mozilla docs, and made a minor comment on your code.

Just to be clear, this change does not affect the //TODO in the code we hacked together for RChain-Status, right? I can file a separate issue for that, but please confirm I'm understanding correctly first.

    const rholangCode = rho`
    new lookup(\`rho:registry:lookup\`), registerCh in {
      lookup!(\`URI\`, *registerCh)|

      for (registerForStatus <- registerCh){
        registerForStatus!(${req.params.name}, ${req.query.sig}, ${req.query.pubKey}, "bogusReturn")
      }
    }
    `.replace("URI", uri) //TODO Do this better
dckc commented 6 years ago

Correct; this code doesn't address the fact that URIs are not expressible in RHOCore.