Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Smart contract deployment support #19

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Conversation

Fossilia
Copy link
Collaborator

@Fossilia Fossilia commented Sep 22, 2022

These changes bring smart contract deployment pyntelope/eospyo. To achieve this, the setcode (setting wasm file) and setabi actions had to be supported, so serialization of abi and wasm files was implemented. Serializing wasm files is simple as they just have to be loaded, converted to hex then converted to bytes, but abi file serialization is more complex and requires each component/field of the abi file to be serialized differently, so new classes for these components were created.

Full list of changes:

  • Support for setting abi file and wasm file (smart contract deployment),
  • The current list of supported abi fields are:
    • Version
    • Types
    • Structs
    • Actions
    • Tables
  • New deploy contract example was added
  • Tests are added for abi and wasm serialization with testing files

There are a few things that need to be added in the future:

  • Support for all abi fields, these fields will be added in the near future (kv_tables only one coming a bit later):
    • ricardian_clauses
    • abi_extensions
    • error_messages
    • Variants
    • action_results
  • Deserialization of abi files

this will lead to implementation of full abi and wasm types,
allowing for smart contract deployment.
- fix pathing issues for tests
- add new simple testing contract files
- add bin_to_hex, save_bytes_to_file, and hex_to_uint8_array functions
- alter abi and wasm types to work with new functions
- delete unnecassary contract files
possible to deploy smart contracts now, needs tests adjusted
needs new example
not all contracts are supported as of now
adjust abi and wasm tests
@Fossilia Fossilia self-assigned this Sep 23, 2022
change/simplify tests to work with new file loading
change example to work with new file loading
additionally, add from_bytes wasm test
also remove external pathlib dependency
change tests to use zip files for binary files to save space
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant