Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

[docs] Add WASM interface C++ reference documentation #9508

Merged
merged 14 commits into from
Sep 25, 2020

Conversation

victorj8
Copy link
Contributor

@victorj8 victorj8 commented Sep 18, 2020

Change Description

Currently there is few documentation about host functions on EOS, this PR provides documentation for some host functions.

Change Type

Select ONE

  • Documentation
  • Stability bug fix
  • Other
  • Other - special case

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

docs.json Show resolved Hide resolved
@lparisc lparisc changed the title Documentation of host functions. [docs] Add WASM interface C++ reference documentation Sep 18, 2020
int32_t get_active_producers(legacy_span<account_name> producers) const;

/**
* Tests a given public key with the recovered public key from digest and signature.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be worth noting somehow that this assertion does not require the EOSIO canonical check to pass. That is, a signature that would have been disallowed during transaction acceptance would potentially be allowed here. Many contract users probably don't care about that detail.. but it's an important subtle behavior of the interface

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am somewhat out of my element here, but if you have a suggested text i can add it, let me know what text should i add.

@spoonincode
Copy link
Contributor

Should the documentation offer any guidance or recommendations on usage patterns of any of these? For example, should the documentation recommend to use the assert_sha256() variant over sha256() if contract's usage pattern allows it. Or, avoiding spamage of eosio_assert() with negative checks.

@lparisc
Copy link
Contributor

lparisc commented Sep 23, 2020

Should the documentation offer any guidance or recommendations on usage patterns of any of these? For example, should the documentation recommend to use the assert_sha256() variant over sha256() if contract's usage pattern allows it. Or, avoiding spamage of eosio_assert() with negative checks.

Yes, of course. If the usage suggestions are short and to the point they can be added in a "remarks" section within the applicable function. However, I believe a separate "overview" section that includes best practices is also desired for devs to be able to use the WASM interface correctly and effectively. To that end, I have created this issue #9518 to keep this effort active. In the meantime I'm approving this unless there are any hard corrections. @victorj8 please wait at least 24 hours before merging in case there are any additional corrections. Thanks! @larryk85

@victorj8 victorj8 merged commit b4d5f9f into develop Sep 25, 2020
@heifner heifner deleted the feature/host-functions-documentation branch June 10, 2021 16:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants