-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Smart contract schema support #274
Conversation
Custom serialization of AbstractAddress. Refactoring of Errors returned from JNI rust layer. Refactoring of BakerKeys- ConfigureBakerKeys- TransferToPublicJni- Result to remove Optional fields.
…eInstanceRequest with SchemaReceiveParameter
… in CryptoJniNative and lib.rs
Added option to construct Schema from an InputStream
Added option to construct Schema from an InputStream
…lass (SchemaParameter). Comments.
…and ContractAddress
… ContractAddress for passing directly as parameters. Moved smart contract related stuff to transactions.smartcontracts. Moved test resources.
…r wrapCCD) implemented and initializes correctly
# Conflicts: # concordium-sdk/src/main/java/com/concordium/sdk/crypto/bakertransactions/BakerKeysResult.java # concordium-sdk/src/main/java/com/concordium/sdk/transactions/UpdateContractPayload.java # concordium-sdk/src/main/java/com/concordium/sdk/types/AccountAddress.java
...les/src/main/java/com/concordium/sdk/examples/contractexample/cis2nft/Cis2NftParameters.java
Outdated
Show resolved
Hide resolved
...les/src/main/java/com/concordium/sdk/examples/contractexample/cis2nft/Cis2NftParameters.java
Show resolved
Hide resolved
...ain/java/com/concordium/sdk/examples/contractexample/parameters/NftBalanceOfQueryParams.java
Show resolved
Hide resolved
...java/com/concordium/sdk/examples/contractexample/parameters/NftTokenMetaDataQueryParams.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few extra comments for now
...amples/src/main/java/com/concordium/sdk/examples/contractexample/parameters/TokenIdUnit.java
Show resolved
Hide resolved
...amples/src/main/java/com/concordium/sdk/examples/contractexample/parameters/TokenIdUnit.java
Outdated
Show resolved
Hide resolved
concordium-sdk/src/test/testresources/smartcontractschema/lib.rs
Outdated
Show resolved
Hide resolved
…finalized transactions
Co-authored-by: Emil Lai <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. GJ.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's not there, as it appears not to be, please add clippy & formatting to the rust JNI bindings, using the standard rustfmt.toml config from concordium-base.
Co-authored-by: Aleš Bizjak <[email protected]>
# Conflicts: # CHANGELOG.md # concordium-sdk/src/main/java/com/concordium/sdk/transactions/Hash.java
Purpose
Adds functionality for creating and serializing smart contract parameters as opposed to only allowing raw bytes as parameters.
Changes
Extended the FFI bindings to allow for passing parameters as json to the rust library and getting the serialized parameter back.
Added
JNINError
class allowing for error messages to be returned from the rust library.Created a class,
Schema
, to represent smart contract schemas.Created a class
SchemaParameter
to represent parameters serializable via aSchema
.Added from methods to
InitContractPayload
andUpdateContractPayload
accepting the newSchemaParameter
.Implemented custom serialization of
AbstractAddress
and addedListParam
,AccountAddressParam
,AddressParam
andContractAddressParam
for conveniently using lists of objects,AbstractAddress
,ContractAddress
andAccountAddress
as smart contract parameters.Extended the examples with
Cis2Nft
andCis2WCCD
demonstrating how to instantiate parameters for the different smart contract methods present in the cis2-nft and cis2-wCCD contracts.Checklist
hard-to-understand areas.