Skip to content

Conversation

@allanbrondum
Copy link
Contributor

@allanbrondum allanbrondum commented Dec 29, 2025

Purpose

Implement concordium_base part of https://linear.app/concordium/issue/PSR-20/remove-upward-from-base-and-copy-plt-cbor-types-to-the-sdk.

Changes

  • Deleted Upward type (to be moved to Rust SDK)
  • Deleted types like TokenModuleRejectReason and TokenEvent. They are to be copied to Rust SDK and to the Rust PLT scheduler as separate types.
  • Introduced enums for event and reject reason types and some helper functions for decoding and encoding CBOR

Checklist

  • My code follows the style of this project.
  • The code compiles without warnings.
  • I have performed a self-review of the changes.
  • I have documented my code, in particular the intent of the
    hard-to-understand areas.
  • (If necessary) I have updated the CHANGELOG.

@allanbrondum allanbrondum changed the base branch from feature/plt-scheduler-port to ar/cor-2097-make-cbor-serialization-infallible-2 January 1, 2026 10:57
/// Handling [`CborMaybeKnown::Unknown`] can be used to implement forwards compatability
/// with future token operations. Unknown token operations can e.g. be ignored, if the handler is only interested
/// in specific and known token operations.
pub fn decode_operations_maybe_known(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type TokenOperationsPayload cannot be moved to Rust SDK, since it is used directly in transaction payloads. So instead of allowing having operations: Vec<CborUpward<TokenOperation>> inside the type TokenOperations, I've added this method to decode to CborSerializationResult<Vec<CborMaybeKnown<TokenOperation>>>. Which allows you to decode to CborMaybeKnown, which gives you the flexibility to handle unknown variants if you want.

/// transaction.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TokenModuleRejectReason {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be moved to Rust PLT scheduler and to Rust SDK as separate types

Base automatically changed from ar/cor-2097-make-cbor-serialization-infallible-2 to feature/plt-scheduler-port January 9, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants