Skip to content
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

EsdtTokenData impl ManagedVecItem #1234

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion framework/base/src/types/flags/esdt_token_type.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use multiversx_sc_derive::ManagedVecItem;

use crate::codec::*;

const ESDT_TYPE_FUNGIBLE: &[u8] = b"FungibleESDT";
Expand All @@ -10,7 +12,7 @@ use crate as multiversx_sc; // needed by the TypeAbi generated code
use crate::derive::TypeAbi;

// Note: In the current implementation, SemiFungible is never returned
#[derive(Clone, PartialEq, Eq, Debug, TypeAbi)]
#[derive(Clone, PartialEq, Eq, Debug, TypeAbi, ManagedVecItem)]
pub enum EsdtTokenType {
Fungible,
NonFungible,
Expand Down
4 changes: 3 additions & 1 deletion framework/base/src/types/managed/wrapped/esdt_token_data.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use multiversx_sc_derive::ManagedVecItem;

use crate::{
api::ManagedTypeApi,
codec,
Expand All @@ -14,7 +16,7 @@ use crate::derive::TypeAbi;

const DECODE_ATTRIBUTE_ERROR_PREFIX: &[u8] = b"error decoding ESDT attributes: ";

#[derive(TopDecode, TopEncode, NestedDecode, NestedEncode, TypeAbi, Debug)]
#[derive(TopDecode, TopEncode, NestedDecode, NestedEncode, TypeAbi, Debug, ManagedVecItem)]
pub struct EsdtTokenData<M: ManagedTypeApi> {
pub token_type: EsdtTokenType,
pub amount: BigUint<M>,
Expand Down
Loading