Skip to content

Commit

Permalink
chore: improve naming
Browse files Browse the repository at this point in the history
  • Loading branch information
dadamu committed Aug 25, 2023
1 parent 4c3874e commit b1d2e94
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion packages/bindings-test/src/posts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ use desmos_bindings::posts::types::{
Entities, Post, QuerySubspacePostsRequest, QuerySubspacePostsResponse, ReplySetting, Url,
};

pub fn create_sample_post(subspace_id: u64, contract_address: &str) -> Post {
/// Creates a post inside the given subspace for interaction testing
pub fn create_test_post(subspace_id: u64, contract_address: &str) -> Post {
let desmos_cli = DesmosCli::default();

// Create a post
Expand Down
10 changes: 5 additions & 5 deletions packages/bindings-test/src/posts/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ mod test {
TEST_DELETABLE_ATTACHMENT_ID, TEST_POLL_ID, TEST_SUBSPACE, TEST_SUBSPACE_DELETABLE_POST_ID,
TEST_SUBSPACE_EDITABLE_POST_ID,
};
use crate::posts::create_sample_post;
use crate::posts::create_test_post;

use chrono::DateTime;
use cosmwasm_std::Addr;
Expand Down Expand Up @@ -230,7 +230,7 @@ mod test {
.last()
.unwrap()
.clone();
let post = create_sample_post(TEST_SUBSPACE, &contract_address);
let post = create_test_post(TEST_SUBSPACE, &contract_address);

let move_post_msg = PostsMsg::move_post(
TEST_SUBSPACE,
Expand All @@ -251,7 +251,7 @@ mod test {
let contract_address = desmos_cli.get_contract_by_code(1, 0);
let receiver_contract_address = desmos_cli.get_contract_by_code(1, 1);

let post = create_sample_post(TEST_SUBSPACE, &contract_address);
let post = create_test_post(TEST_SUBSPACE, &contract_address);
let request_post_owner_transfer_msg = PostsMsg::request_post_owner_transfer(
TEST_SUBSPACE,
post.id,
Expand Down Expand Up @@ -283,7 +283,7 @@ mod test {
let receiver_contract_address = desmos_cli.get_contract_by_code(1, 1);

// Create a post owner transfer request to receiver
let post = create_sample_post(TEST_SUBSPACE, &contract_address);
let post = create_test_post(TEST_SUBSPACE, &contract_address);
let request_post_owner_transfer_msg = PostsMsg::request_post_owner_transfer(
TEST_SUBSPACE,
post.id,
Expand Down Expand Up @@ -315,7 +315,7 @@ mod test {
let receiver_contract_address = desmos_cli.get_contract_by_code(1, 1);

// Create a post owner transfer request to receiver
let post = create_sample_post(TEST_SUBSPACE, &contract_address);
let post = create_test_post(TEST_SUBSPACE, &contract_address);
let request_post_owner_transfer_msg = PostsMsg::request_post_owner_transfer(
TEST_SUBSPACE,
post.id,
Expand Down
4 changes: 2 additions & 2 deletions packages/bindings-test/src/posts/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
mod test {
use crate::chain_communication::DesmosCli;
use crate::consts::{TEST_POLL_ID, TEST_SUBSPACE, TEST_SUBSPACE_EDITABLE_POST_ID};
use crate::posts::create_sample_post;
use crate::posts::create_test_post;
use chrono::DateTime;
use cosmwasm_std::Addr;
use desmos_bindings::posts::msg::PostsMsg;
Expand Down Expand Up @@ -242,7 +242,7 @@ mod test {
let contract_address = desmos_cli.get_contract_by_code(1, 0);
let receiver_contract_address = desmos_cli.get_contract_by_code(1, 1);

let post = create_sample_post(TEST_SUBSPACE, &contract_address);
let post = create_test_post(TEST_SUBSPACE, &contract_address);
desmos_cli
.execute_contract(
&contract_address,
Expand Down

0 comments on commit b1d2e94

Please sign in to comment.