Skip to content

Commit

Permalink
Rename Block to BlockResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmauro committed Nov 26, 2023
1 parent b75953d commit 9b6e2f0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions algonaut_algod/src/apis/public_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use reqwest;

use super::{configuration, Error};
use crate::{apis::ResponseContent, ext::block::Block};
use crate::{apis::ResponseContent, ext::block::BlockResponse};

/// struct for typed errors of method [`account_application_information`]
#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down Expand Up @@ -830,7 +830,7 @@ pub async fn get_block(
configuration: &configuration::Configuration,
round: u64,
format: Option<&str>,
) -> Result<Block, Error<GetBlockError>> {
) -> Result<BlockResponse, Error<GetBlockError>> {
let local_var_configuration = configuration;

let local_var_client = &local_var_configuration.client;
Expand Down
12 changes: 6 additions & 6 deletions algonaut_algod/src/ext/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ use serde::{Deserialize, Serialize};

/// Block
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Block {
pub struct BlockResponse {
/// Block header data.
pub block: BlockHeader,
pub block: Block,
}

/// Block with certificate
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct BlockWithCertificate {
pub struct BlockWithCertificateResponse {
/// Block header data
pub block: BlockHeader,
pub block: Block,
/// Certificate
pub cert: BlockCertificate,
}

impl BlockWithCertificate {
impl BlockWithCertificateResponse {
pub fn hash(&self) -> HashDigest {
self.cert.prop.hash
}
Expand All @@ -36,7 +36,7 @@ pub struct BlockCertificateProp {
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct BlockHeader {
pub struct Block {
#[serde(rename = "earn")]
pub rewards_level: Option<u64>,
#[serde(rename = "fees")]
Expand Down
4 changes: 2 additions & 2 deletions src/algod/v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use self::error::AlgodError;
use crate::Error;
use algonaut_algod::{
apis::configuration::{ApiKey, Configuration},
ext::block::Block,
ext::block::BlockResponse,
models::{
self, Account, AccountApplicationInformation200Response, Application, Asset, DryrunRequest,
GetApplicationBoxes200Response, GetBlockHash200Response,
Expand Down Expand Up @@ -133,7 +133,7 @@ impl Algod {
}

/// Get the block for the given round.
pub async fn block(&self, round: u64) -> Result<Block, Error> {
pub async fn block(&self, round: u64) -> Result<BlockResponse, Error> {
Ok(
algonaut_algod::apis::public_api::get_block(&self.configuration, round, None)
.await
Expand Down

0 comments on commit 9b6e2f0

Please sign in to comment.