diff --git a/src/events.rs b/src/events.rs index 76a4a2c..8fe303a 100644 --- a/src/events.rs +++ b/src/events.rs @@ -129,6 +129,7 @@ pub trait EventsModule { #[indexed] token: &EgldOrEsdtTokenIdentifier, #[indexed] price: &BigUint, #[indexed] bond_amount: &BigUint, + #[indexed] extra_assets: &ManagedVec ); #[event("setWithdrawalAddress")] diff --git a/src/lib.rs b/src/lib.rs index 2be9e56..7e2faac 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -148,6 +148,7 @@ pub trait DataNftMint: title: ManagedBuffer, description: ManagedBuffer, lock_period_sec: u64, + extra_assets: MultiValueEncoded, ) -> DataNftAttributes { self.require_ready_for_minting_and_burning(); require!(!data_stream.is_empty(), ERR_DATA_STREAM_IS_EMPTY); @@ -205,13 +206,14 @@ pub trait DataNftMint: }; let token_identifier = self.token_id().get_token_id(); - + let extra_assets_vec = extra_assets.into_vec_of_buffers(); self.mint_event( &caller, &one_token, &payment.token_identifier, &price, &payment.amount, + &extra_assets_vec ); let nonce = self.send().esdt_nft_create( @@ -221,7 +223,7 @@ pub trait DataNftMint: &royalties, &self.create_hash_buffer(&data_marshal, &data_stream), &attributes, - &self.create_uris(media, metadata), + &self.create_uris(media, metadata, extra_assets_vec), ); self.send_bond( diff --git a/src/nft_mint_utils.rs b/src/nft_mint_utils.rs index bbe07e5..5820c18 100644 --- a/src/nft_mint_utils.rs +++ b/src/nft_mint_utils.rs @@ -18,10 +18,12 @@ pub trait NftMintUtils: crate::storage::StorageModule { &self, media: ManagedBuffer, metadata: ManagedBuffer, + extra_assets: ManagedVec, ) -> ManagedVec { let mut uris = ManagedVec::new(); uris.push(media); uris.push(metadata); + uris.append_vec(extra_assets); uris } } diff --git a/tests/minter_state/minter_state.rs b/tests/minter_state/minter_state.rs index ed70780..c54aae0 100644 --- a/tests/minter_state/minter_state.rs +++ b/tests/minter_state/minter_state.rs @@ -565,6 +565,7 @@ impl ContractsState { title, description, lock_period, + MultiValueEncoded::new() )) .expect(expect.unwrap_or(TxExpect::ok())), );