From 62dfbcffe58325d81efd0ecf4994e96f8a8a8e47 Mon Sep 17 00:00:00 2001 From: Peter White Date: Mon, 16 Dec 2024 09:21:48 -0700 Subject: [PATCH] Make extrinsic call types, upload, and events public (#1873) * make extrinsic calls types, upload, and events pub chore: make events public chore: make types pub for use in other crates * chore: update changelog --- CHANGELOG.md | 4 ++++ crates/extrinsics/src/extrinsic_calls.rs | 8 ++++---- crates/extrinsics/src/lib.rs | 8 ++++---- crates/extrinsics/src/upload.rs | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7804fdaa1..ddaa5f438 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +[Unreleased] +### Changed +- Make extrinsic call types, upload, and events public - [#1873](https://github.com/use-ink/cargo-contract/pull/1873) + ## [5.0.1] ### Changed diff --git a/crates/extrinsics/src/extrinsic_calls.rs b/crates/extrinsics/src/extrinsic_calls.rs index 3330b3d33..97b803150 100644 --- a/crates/extrinsics/src/extrinsic_calls.rs +++ b/crates/extrinsics/src/extrinsic_calls.rs @@ -77,7 +77,7 @@ impl RemoveCode { /// A raw call to `pallet-contracts`'s `upload_code`. #[derive(Debug, EncodeAsType)] #[encode_as_type(crate_path = "subxt::ext::scale_encode")] -pub(crate) struct UploadCode { +pub struct UploadCode { code: Vec, storage_deposit_limit: Option>, determinism: Determinism, @@ -104,7 +104,7 @@ impl UploadCode { /// A raw call to `pallet-contracts`'s `instantiate_with_code`. #[derive(Debug, EncodeAsType)] #[encode_as_type(crate_path = "subxt::ext::scale_encode")] -pub(crate) struct InstantiateWithCode { +pub struct InstantiateWithCode { #[codec(compact)] value: Balance, gas_limit: Weight, @@ -141,7 +141,7 @@ impl InstantiateWithCode { /// A raw call to `pallet-contracts`'s `instantiate_with_code_hash`. #[derive(Debug, EncodeAsType)] #[encode_as_type(crate_path = "subxt::ext::scale_encode")] -pub(crate) struct Instantiate +pub struct Instantiate where Hash: EncodeAsType, { @@ -184,7 +184,7 @@ where /// A raw call to `pallet-contracts`'s `call`. #[derive(EncodeAsType)] #[encode_as_type(crate_path = "subxt::ext::scale_encode")] -pub(crate) struct Call { +pub struct Call { dest: MultiAddress, #[codec(compact)] value: Balance, diff --git a/crates/extrinsics/src/lib.rs b/crates/extrinsics/src/lib.rs index 126b3327b..3d1b2e4c9 100644 --- a/crates/extrinsics/src/lib.rs +++ b/crates/extrinsics/src/lib.rs @@ -21,14 +21,14 @@ mod contract_info; mod contract_storage; mod env_check; mod error; -mod events; -mod extrinsic_calls; -mod extrinsic_opts; +pub mod events; +pub mod extrinsic_calls; +pub mod extrinsic_opts; mod instantiate; pub mod pallet_contracts_primitives; mod remove; mod rpc; -mod upload; +pub mod upload; #[cfg(test)] mod contract_storage_tests; diff --git a/crates/extrinsics/src/upload.rs b/crates/extrinsics/src/upload.rs index 699227a67..f6b0a0d52 100644 --- a/crates/extrinsics/src/upload.rs +++ b/crates/extrinsics/src/upload.rs @@ -203,7 +203,7 @@ pub struct UploadResult { #[allow(dead_code)] #[derive(Debug, Encode, EncodeAsType)] #[encode_as_type(crate_path = "subxt::ext::scale_encode")] -pub(crate) enum Determinism { +pub enum Determinism { /// The execution should be deterministic and hence no indeterministic instructions /// are allowed. ///