Skip to content

Commit

Permalink
EsdtTokenData impl ManagedVecItem
Browse files Browse the repository at this point in the history
  • Loading branch information
alyn509 committed Oct 10, 2023
1 parent d9c77f6 commit 13812c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
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

0 comments on commit 13812c2

Please sign in to comment.