Skip to content
Snippets Groups Projects
Select Git revision
  • ea53551483d2dc1ef4045ee93edd1e0a71856673
  • dev default protected
  • release/1.9.1 protected
  • pini-1.8-docker
  • pini-sync-onlypeers
  • duniter-v2s-issue-123-industrialize-releases
  • feature/build-aarch64-nodejs16
  • release/1.8 protected
  • pini-docker
  • ci_tags
  • fix/1448/1.8/txs_not_stored
  • feature/node-20
  • fix/1441/node_summary_with_storage
  • fix/1442/improve_bma_tx_history
  • feature/wotwizard-1.8
  • release/1.9 protected
  • 1.7 protected
  • feature/docker-set-latest protected
  • feature/fast-docker-build-1.8.4
  • fast-docker-build protected
  • feature/dump-distance
  • v1.8.7 protected
  • v1.8.7-rc4 protected
  • v1.8.7-rc3 protected
  • v1.8.7-rc2 protected
  • v1.8.7-rc1 protected
  • v1.8.6 protected
  • v1.7.23 protected
  • v1.8.5 protected
  • v1.8.4 protected
  • v1.8.3 protected
  • v1.8.2 protected
  • v1.8.1 protected
  • v1.8.0 protected
  • v1.8.0-rc1 protected
  • v1.8.0-beta5 protected
  • v1.8.0-beta4 protected
  • v1.8.0-beta3 protected
  • v1.8.0-beta2 protected
  • v1.8.0-beta protected
  • v1.7.21 protected
41 results

server.js

Blame
  • commented.rs 990 B
    use crate::*;
    
    #[cfg(any(feature = "dev", feature = "gdev"))] // find how to get runtime calls
    type Call = runtime::runtime_types::gdev_runtime::RuntimeCall;
    type BalancesCall = runtime::runtime_types::pallet_balances::pallet::Call;
    type SystemCall = runtime::runtime_types::frame_system::pallet::Call;
    
    /// commented balance transfer
    pub async fn transfer(
    	data: &Data,
    	amount: u64,
    	dest: AccountId,
    	comment: String,
    ) -> Result<(), subxt::Error> {
    	// build transfer call
    	let transfer_call = Call::Balances(BalancesCall::transfer_keep_alive {
    		dest: dest.into(),
    		value: amount,
    	});
    	// build comment call
    	let comment_call = Call::System(SystemCall::remark_with_event {
    		remark: comment.as_bytes().to_vec(),
    	});
    
    	// wrap these calls in a batch call
    	submit_call_and_look_event::<
    		runtime::utility::events::BatchCompleted,
    		Payload<runtime::utility::calls::types::Batch>,
    	>(
    		data,
    		&runtime::tx()
    			.utility()
    			.batch(vec![transfer_call, comment_call]),
    	)
    	.await
    }