Skip to content

Commit

Permalink
apdated near-socialdb-client in [dependencies]
Browse files Browse the repository at this point in the history
  • Loading branch information
FroVolod committed Oct 7, 2023
1 parent 137808e commit 99ea8ad
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 29 deletions.
7 changes: 4 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ keyring = "2.0.5"
interactive-clap = "0.2.6"
interactive-clap-derive = "0.2.6"

near-socialdb-client-rs = {git = "https://github.com/bos-cli-rs/near-socialdb-client-rs"}
near-socialdb-client = "0.1.0"

[features]
default = ["ledger", "self-update"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl AccountContext {
.wrap_err_with(|| {
"Failed to fetch query for view method: 'storage_balance_of'"
})?
.parse_result_from_json::<near_socialdb_client_rs::StorageBalance>()
.parse_result_from_json::<near_socialdb_client::StorageBalance>()
.wrap_err_with(|| {
"Failed to parse return value of view function call for StorageBalance."
})?;
Expand Down
2 changes: 1 addition & 1 deletion src/commands/account/update_social_profile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mod sign_as;

#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct TransactionFunctionArgs {
pub data: near_socialdb_client_rs::types::socialdb_types::SocialDb,
pub data: near_socialdb_client::types::socialdb_types::SocialDb,
}

#[derive(Debug, Clone, interactive_clap::InteractiveClap)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,29 +53,25 @@ impl ManuallyContext {
previous_context: super::super::UpdateSocialProfileContext,
scope: &<Manually as interactive_clap::ToInteractiveClapContextScope>::InteractiveClapContextScope,
) -> color_eyre::eyre::Result<Self> {
let profile = near_socialdb_client_rs::types::socialdb_types::Profile {
let profile = near_socialdb_client::types::socialdb_types::Profile {
name: scope.name.clone(),
image: if scope.image_url.is_none() && scope.image_ipfs_cid.is_none() {
None
} else {
Some(
near_socialdb_client_rs::types::socialdb_types::ProfileImage {
url: scope.image_url.clone().map(|url| url.into()),
ipfs_cid: scope.image_ipfs_cid.clone(),
},
)
Some(near_socialdb_client::types::socialdb_types::ProfileImage {
url: scope.image_url.clone().map(|url| url.into()),
ipfs_cid: scope.image_ipfs_cid.clone(),
})
},
background_image: if scope.background_image_url.is_none()
&& scope.background_image_ipfs_cid.is_none()
{
None
} else {
Some(
near_socialdb_client_rs::types::socialdb_types::ProfileImage {
url: scope.background_image_url.clone().map(|url| url.into()),
ipfs_cid: scope.background_image_ipfs_cid.clone(),
},
)
Some(near_socialdb_client::types::socialdb_types::ProfileImage {
url: scope.background_image_url.clone().map(|url| url.into()),
ipfs_cid: scope.background_image_ipfs_cid.clone(),
})
},
description: scope.description.clone(),
linktree: if scope.twitter.is_none()
Expand Down
10 changes: 5 additions & 5 deletions src/commands/account/update_social_profile/sign_as.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl From<SignerContext> for crate::commands::ActionContext {
near_primitives::types::Finality::Final.into(),
)
.wrap_err_with(|| {format!("Failed to fetch query for view method: 'get {account_id}/profile/**'")})?
.parse_result_from_json::<near_socialdb_client_rs::types::socialdb_types::SocialDb>()
.parse_result_from_json::<near_socialdb_client::types::socialdb_types::SocialDb>()
.wrap_err_with(|| {
format!("Failed to parse view function call return value for {account_id}/profile.")
})?
Expand All @@ -83,7 +83,7 @@ impl From<SignerContext> for crate::commands::ActionContext {
};

let deposit = tokio::runtime::Runtime::new().unwrap().block_on(
near_socialdb_client_rs::required_deposit(
near_socialdb_client::required_deposit(
&json_rpc_client,
&contract_account_id,
&account_id,
Expand All @@ -93,10 +93,10 @@ impl From<SignerContext> for crate::commands::ActionContext {
)?;

let new_social_db_state =
near_socialdb_client_rs::types::socialdb_types::SocialDb {
near_socialdb_client::types::socialdb_types::SocialDb {
accounts: HashMap::from([(
account_id.clone(),
near_socialdb_client_rs::types::socialdb_types::AccountProfile {
near_socialdb_client::types::socialdb_types::AccountProfile {
profile: serde_json::from_value(local_profile)?,
},
)]),
Expand Down Expand Up @@ -132,7 +132,7 @@ impl From<SignerContext> for crate::commands::ActionContext {
{
action.deposit = tokio::runtime::Runtime::new()
.unwrap()
.block_on(near_socialdb_client_rs::get_deposit(
.block_on(near_socialdb_client::get_deposit(
&json_rpc_client,
&signer_account_id,
&prepopulated_unsigned_transaction.public_key,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/account/view_account_summary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl ViewAccountSummaryContext {
block_reference.clone(),
)
.wrap_err_with(|| {format!("Failed to fetch query for view method: 'get {account_id}/profile/**'")})?
.parse_result_from_json::<near_socialdb_client_rs::types::socialdb_types::SocialDb>()
.parse_result_from_json::<near_socialdb_client::types::socialdb_types::SocialDb>()
.wrap_err_with(|| {
format!("Failed to parse view function call return value for {account_id}/profile.")
})?;
Expand Down
6 changes: 2 additions & 4 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl std::fmt::Display for BlockHashAsBase58 {
}
}

pub use near_socialdb_client_rs::NearBalance;
pub use near_socialdb_client::NearBalance;

pub use near_gas::NearGas;

Expand Down Expand Up @@ -1282,9 +1282,7 @@ pub fn display_account_info(
account_id: &near_primitives::types::AccountId,
account_view: &near_primitives::views::AccountView,
access_keys: &[near_primitives::views::AccessKeyInfoView],
optional_account_profile: Option<
&near_socialdb_client_rs::types::socialdb_types::AccountProfile,
>,
optional_account_profile: Option<&near_socialdb_client::types::socialdb_types::AccountProfile>,
) {
let mut table = Table::new();
table.set_format(*prettytable::format::consts::FORMAT_NO_COLSEP);
Expand Down

0 comments on commit 99ea8ad

Please sign in to comment.