AntelopeIO / cdt

Contract Development Toolkit (CDT) is a suite of tools to facilitate C/C++ development of contracts for Antelope blockchains
Other
28 stars 31 forks source link

IF: CDT support for IF host function #210

Closed arhag closed 9 months ago

arhag commented 1 year ago

Depends on https://github.com/AntelopeIO/leap/issues/1511.

Add C++ wrapper for the new set_finalizers host function introduced with the IF protocol feature. Ensure this is added into a header file in a way that prevents a contract compiling with the new version of CDT but that does not actually use the new wrapper function from accidentally including set_finalizers as a dependency in the compiled WASM file.

Should be done at same time as https://github.com/AntelopeIO/reference-contracts/issues/26 (Finalizer Action for Bios Contract)

heifner commented 1 year ago

set_finalizer host function available in leap branch hotstuff_integration

The struct used for set_finalizers is: https://github.com/AntelopeIO/leap/pull/1588

   struct abi_finalizer_authority {
      std::string              description;
      uint64_t                 fweight = 0; // weight that this finalizer's vote has for meeting fthreshold
      std::array<uint8_t, 144> public_key_g1_jacobian; // Jacobian little endian
   };
   struct abi_finalizer_set {
      uint64_t                             fthreshold = 0;
      std::vector<abi_finalizer_authority> finalizers;
   };