Skip to content

Commit

Permalink
Update examples, erase mentions of StateClone
Browse files Browse the repository at this point in the history
  • Loading branch information
target-san committed Jul 28, 2023
1 parent 7dc4f11 commit fcc668d
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions examples/cis2-multi-royalties/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ struct CheckRoyaltyResult {
}

/// The state for each address.
#[derive(Serial, DeserialWithState, Deletable, StateClone)]
#[derive(Serial, DeserialWithState, Deletable)]
#[concordium(state_parameter = "S")]
struct AddressState<S> {
/// The amount of tokens owned by this address.
Expand Down Expand Up @@ -138,7 +138,7 @@ impl<S: HasStateApi> AddressState<S> {
///
/// Note: The specification does not specify how to structure the contract state
/// and this could be structured in a more space efficient way.
#[derive(Serial, DeserialWithState, StateClone)]
#[derive(Serial, DeserialWithState)]
#[concordium(state_parameter = "S")]
struct State<S> {
/// The state of addresses.
Expand Down
4 changes: 2 additions & 2 deletions examples/cis2-multi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct SetImplementorsParams {
}

/// The state for each address.
#[derive(Serial, DeserialWithState, Deletable, StateClone)]
#[derive(Serial, DeserialWithState, Deletable)]
#[concordium(state_parameter = "S")]
struct AddressState<S> {
/// The amount of tokens owned by this address.
Expand All @@ -93,7 +93,7 @@ impl<S: HasStateApi> AddressState<S> {
///
/// Note: The specification does not specify how to structure the contract state
/// and this could be structured in a more space efficient way.
#[derive(Serial, DeserialWithState, StateClone)]
#[derive(Serial, DeserialWithState)]
#[concordium(state_parameter = "S")]
struct State<S> {
/// The state of addresses.
Expand Down
4 changes: 2 additions & 2 deletions examples/cis2-nft/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct MintParams {
}

/// The state for each address.
#[derive(Serial, DeserialWithState, Deletable, StateClone)]
#[derive(Serial, DeserialWithState, Deletable)]
#[concordium(state_parameter = "S")]
struct AddressState<S> {
/// The tokens owned by this address.
Expand All @@ -76,7 +76,7 @@ impl<S: HasStateApi> AddressState<S> {
/// The contract state.
// Note: The specification does not specify how to structure the contract state
// and this could be structured in a more space efficient way depending on the use case.
#[derive(Serial, DeserialWithState, StateClone)]
#[derive(Serial, DeserialWithState)]
#[concordium(state_parameter = "S")]
struct State<S> {
/// The state for each address.
Expand Down
4 changes: 2 additions & 2 deletions examples/cis2-wccd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type ContractTokenId = TokenIdUnit;
type ContractTokenAmount = TokenAmountU64;

/// The state tracked for each address.
#[derive(Serial, DeserialWithState, Deletable, StateClone)]
#[derive(Serial, DeserialWithState, Deletable)]
#[concordium(state_parameter = "S")]
struct AddressState<S> {
/// The number of tokens owned by this address.
Expand All @@ -74,7 +74,7 @@ struct AddressState<S> {
}

/// The contract state,
#[derive(Serial, DeserialWithState, StateClone)]
#[derive(Serial, DeserialWithState)]
#[concordium(state_parameter = "S")]
struct State<S: HasStateApi> {
/// The admin address can upgrade the contract, pause and unpause the
Expand Down
4 changes: 2 additions & 2 deletions examples/cis3-nft-sponsored-txs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ struct MintParams {
}

/// The state for each address.
#[derive(Serial, DeserialWithState, Deletable, StateClone)]
#[derive(Serial, DeserialWithState, Deletable)]
#[concordium(state_parameter = "S")]
struct AddressState<S> {
/// The tokens owned by this address.
Expand All @@ -241,7 +241,7 @@ impl<S: HasStateApi> AddressState<S> {
/// The contract state.
// Note: The specification does not specify how to structure the contract state
// and this could be structured in a more space efficient way depending on the use case.
#[derive(Serial, DeserialWithState, StateClone)]
#[derive(Serial, DeserialWithState)]
#[concordium(state_parameter = "S")]
struct State<S> {
/// Counter to increase the `token_id` at every mint function invoke.
Expand Down
2 changes: 1 addition & 1 deletion examples/credential-registry-storage-contract/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct CredentialState {
}

/// The contract state.
#[derive(Serial, DeserialWithState, StateClone)]
#[derive(Serial, DeserialWithState)]
#[concordium(state_parameter = "S")]
struct State<S: HasStateApi> {
/// All verifiable credentials.
Expand Down
2 changes: 1 addition & 1 deletion examples/credential-registry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl<S: HasStateApi> CredentialEntry<S> {
}

/// The registry state.
#[derive(Serial, DeserialWithState, StateClone)]
#[derive(Serial, DeserialWithState)]
#[concordium(state_parameter = "S")]
pub struct State<S: HasStateApi> {
/// An account address of the issuer. It is used for authorization in
Expand Down
2 changes: 1 addition & 1 deletion examples/eSealing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct FileState {
}

/// The contract state.
#[derive(Serial, DeserialWithState, StateClone)]
#[derive(Serial, DeserialWithState)]
#[concordium(state_parameter = "S")]
struct State<S> {
files: StateMap<HashSha2256, FileState, S>,
Expand Down
6 changes: 3 additions & 3 deletions examples/nametoken/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ struct RegisterNameParams {
}

/// Data for each name.
#[derive(Serial, DeserialWithState, Deletable, StateClone)]
#[derive(Serial, DeserialWithState, Deletable)]
#[concordium(state_parameter = "S")]
struct NameInfo<S: HasStateApi> {
/// Name owner
Expand Down Expand Up @@ -119,7 +119,7 @@ impl<S: HasStateApi> NameInfo<S> {
}

/// The state for each address.
#[derive(Serial, DeserialWithState, Deletable, StateClone)]
#[derive(Serial, DeserialWithState, Deletable)]
#[concordium(state_parameter = "S")]
struct AddressState<S> {
/// The tokens owned by this address.
Expand All @@ -139,7 +139,7 @@ impl<S: HasStateApi> AddressState<S> {

/// The contract state.

#[derive(Serial, DeserialWithState, StateClone)]
#[derive(Serial, DeserialWithState)]
#[concordium(state_parameter = "S")]
struct State<S: HasStateApi> {
/// The address of the administrating account.
Expand Down
2 changes: 1 addition & 1 deletion examples/offchain-transfers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ pub struct ContractConfig {
}

/// The smart contract state
#[derive(StateClone, Serial, DeserialWithState)]
#[derive(Serial, DeserialWithState)]
#[concordium(state_parameter = "S")]
pub struct State<S> {
/// The configuration of the contract
Expand Down
2 changes: 1 addition & 1 deletion examples/recorder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//! This contract tests a reasonably small example of state interactions.
use concordium_std::*;

#[derive(Serial, DeserialWithState, StateClone)]
#[derive(Serial, DeserialWithState)]
#[concordium(state_parameter = "S")]
struct State<S> {
addresses: StateSet<AccountAddress, S>,
Expand Down
2 changes: 1 addition & 1 deletion examples/two-step-transfer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ struct InitParams {
transfer_request_ttl: TransferRequestTimeToLiveMilliseconds,
}

#[derive(Serial, DeserialWithState, StateClone)]
#[derive(Serial, DeserialWithState)]
#[concordium(state_parameter = "S")]
pub struct State<S> {
/// The initial configuration of the contract
Expand Down
2 changes: 1 addition & 1 deletion examples/voting/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ struct VotingView {
}

/// The contract state
#[derive(Serial, DeserialWithState, StateClone)]
#[derive(Serial, DeserialWithState)]
#[concordium(state_parameter = "S")]
struct State<S: HasStateApi> {
/// The description of the election.
Expand Down
4 changes: 2 additions & 2 deletions templates/cis2-nft/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct MintParams {
}

/// The state for each address.
#[derive(Serial, DeserialWithState, Deletable, StateClone)]
#[derive(Serial, DeserialWithState, Deletable)]
#[concordium(state_parameter = "S")]
struct AddressState<S> {
/// The tokens owned by this address.
Expand All @@ -76,7 +76,7 @@ impl<S: HasStateApi> AddressState<S> {
/// The contract state.
// Note: The specification does not specify how to structure the contract state
// and this could be structured in a more space efficient way depending on the use case.
#[derive(Serial, DeserialWithState, StateClone)]
#[derive(Serial, DeserialWithState)]
#[concordium(state_parameter = "S")]
struct State<S> {
/// The state for each address.
Expand Down

0 comments on commit fcc668d

Please sign in to comment.