difftreelog
feat submit chain extension produced logs
in: master
1 file changed
runtime/src/chain_extension.rsdiffbeforeafterboth929293 let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;93 let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;949495 match pallet_nft::Module::<C>::transfer_internal(95 pallet_nft::Module::<C>::transfer_internal(96 &C::CrossAccountId::from_sub(env.ext().caller().clone()),96 &C::CrossAccountId::from_sub(env.ext().caller().clone()),97 &C::CrossAccountId::from_sub(input.recipient),97 &C::CrossAccountId::from_sub(input.recipient),98 &collection,98 &collection,99 input.token_id,99 input.token_id,100 input.amount,100 input.amount,101 ) {101 )?;102102 Ok(_) => Ok(RetVal::Converging(func_id)),103 pallet_nft::Module::<C>::submit_logs(collection)?;103 _ => Err(DispatchError::Other("Transfer error"))104 Ok(RetVal::Converging(func_id))104 }105 },105 },106 1 => {106 1 => {107 // Create Item107 // Create Item110110111 let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;111 let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;112112113 match pallet_nft::Module::<C>::create_item_internal(113 pallet_nft::Module::<C>::create_item_internal(114 &C::CrossAccountId::from_sub(env.ext().address().clone()),114 &C::CrossAccountId::from_sub(env.ext().address().clone()),115 &collection,115 &collection,116 &C::CrossAccountId::from_sub(input.owner),116 &C::CrossAccountId::from_sub(input.owner),117 input.data,117 input.data,118 ) {118 )?;119119 Ok(_) => Ok(RetVal::Converging(func_id)),120 pallet_nft::Module::<C>::submit_logs(collection)?;120 _ => Err(DispatchError::Other("CreateItem error"))121 Ok(RetVal::Converging(func_id))121 }122 },122 },123 2 => {123 2 => {124 // Create multiple items124 // Create multiple items127127128 let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;128 let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;129129130 match pallet_nft::Module::<C>::create_multiple_items_internal(130 pallet_nft::Module::<C>::create_multiple_items_internal(131 &C::CrossAccountId::from_sub(env.ext().address().clone()),131 &C::CrossAccountId::from_sub(env.ext().address().clone()),132 &collection,132 &collection,133 &C::CrossAccountId::from_sub(input.owner),133 &C::CrossAccountId::from_sub(input.owner),134 input.data,134 input.data,135 ) {135 )?;136136 Ok(_) => Ok(RetVal::Converging(func_id)),137 pallet_nft::Module::<C>::submit_logs(collection)?;137 _ => Err(DispatchError::Other("CreateMultipleItems error"))138 Ok(RetVal::Converging(func_id))138 }139 },139 },140 3 => {140 3 => {141 // Approve141 // Approve152 input.amount,152 input.amount,153 )?;153 )?;154155 pallet_nft::Module::<C>::submit_logs(collection)?;154 Ok(RetVal::Converging(func_id))156 Ok(RetVal::Converging(func_id))155 },157 },156 4 => {158 4 => {169 input.amount171 input.amount170 )?;172 )?;173174 pallet_nft::Module::<C>::submit_logs(collection)?;171 Ok(RetVal::Converging(func_id))175 Ok(RetVal::Converging(func_id))172 },176 },173 5 => {177 5 => {184 input.data,188 input.data,185 )?;189 )?;190191 pallet_nft::Module::<C>::submit_logs(collection)?;186 Ok(RetVal::Converging(func_id))192 Ok(RetVal::Converging(func_id))187 },193 },188 6 => {194 6 => {199 input.whitelisted,205 input.whitelisted,200 )?;206 )?;207 208 pallet_nft::Module::<C>::submit_logs(collection)?;201 Ok(RetVal::Converging(func_id))209 Ok(RetVal::Converging(func_id))202 }210 }203 _ => {211 _ => {