#[macro_export]
macro_rules! impl_client_v17__generate_to_address {
() => {
impl Client {
pub fn generate_to_address(
&self,
nblocks: usize,
address: &bitcoin::Address,
) -> Result<GenerateToAddress> {
self.call("generatetoaddress", &[nblocks.into(), into_json(address)?])
}
}
};
}
#[macro_export]
macro_rules! impl_client_v17__generate {
() => {
impl Client {
pub fn generate(&self, nblocks: usize) -> Result<Generate> {
self.call("generate", &[nblocks.into()])
}
}
};
}
#[macro_export]
macro_rules! impl_client_v17__invalidate_block {
() => {
impl Client {
pub fn invalidate_block(&self, hash: BlockHash) -> Result<()> {
match self.call("invalidateblock", &[into_json(hash)?]) {
Ok(serde_json::Value::Null) => Ok(()),
Ok(res) => Err(Error::Returned(res.to_string())),
Err(err) => Err(err.into()),
}
}
}
};
}