Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support new x/posts features #301

Merged
merged 16 commits into from
Nov 9, 2023
Merged

Conversation

dadamu
Copy link
Contributor

@dadamu dadamu commented Aug 23, 2023

Deps: #300
Deps #308
Deps: #362

This PR intends to support new posts msgs and queries.

@dadamu dadamu marked this pull request as draft August 23, 2023 11:55
@dadamu dadamu force-pushed the paul/support-new-posts-features branch from 1e1eabe to fb8e6d7 Compare August 23, 2023 12:00
@@ -1,35 +0,0 @@
#!/usr/bin/env bash
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed it since it is unused.

Comment on lines +36 to +40
# Initialize the second contract
echo "Initializing second contract..."
echo $KEYRING_PASS | desmos --keyring-backend=file tx wasm instantiate 1 "{}" \
--from $USER1 --label "test-contract-" --admin $USER1_ADDRESS --chain-id=testchain -b=sync -y
echo "Second contract initialized"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is for testing receiver of MsgAcceptPostOwnerTransferRequest and MsgRefusePostOwnerTransferRequest contract, the second contract is used as receiver.

@dadamu
Copy link
Contributor Author

dadamu commented Aug 24, 2023

The query interaction test errors since missing stargate queries registration:
desmos-labs/desmos#1218

@@ -116,13 +116,16 @@ impl DesmosCli {
/// Gets a contract address by it's id.
///
/// * `id` - ID of the contract of interest.
pub fn get_contract_by_code(&self, id: u64) -> String {
/// * `offset` - Offset of the target contract.
pub fn get_contract_by_code(&self, id: u64, offset: usize) -> String {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add offset parameter for triggering between sender contract and receiver contract.

@dadamu dadamu force-pushed the paul/support-new-posts-features branch from 02e0c40 to b1d2e94 Compare August 25, 2023 10:55
};

/// Creates a post inside the given subspace for interaction testing
pub fn create_test_post(subspace_id: u64, contract_address: &str) -> Post {
Copy link
Contributor Author

@dadamu dadamu Aug 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make test stateless, we can create a post then return it for the test, then we can avoid from a lot of const number like TEST_MOVABLE_POST and etc.

@dadamu dadamu changed the title feat: support new posts features feat: support new x/posts features Aug 29, 2023
@dadamu dadamu force-pushed the paul/support-new-posts-features branch from b1d2e94 to 554627e Compare August 29, 2023 11:49
@dadamu
Copy link
Contributor Author

dadamu commented Aug 29, 2023

The test will be passed after this PR released desmos-labs/desmos#1218

@dadamu dadamu force-pushed the paul/support-new-posts-features branch 2 times, most recently from ec0e025 to 5defba3 Compare August 31, 2023 08:28
@dadamu dadamu requested a review from manu0466 August 31, 2023 08:31
@dadamu dadamu marked this pull request as ready for review August 31, 2023 08:31
@dadamu dadamu marked this pull request as draft August 31, 2023 13:49
@dadamu
Copy link
Contributor Author

dadamu commented Aug 31, 2023

The tests would be passed after desmos-labs/desmos#1226 released.

@dadamu dadamu force-pushed the paul/support-new-posts-features branch from 79b41d5 to 144cd56 Compare November 2, 2023 08:32
@dadamu dadamu marked this pull request as ready for review November 3, 2023 11:10
@dadamu
Copy link
Contributor Author

dadamu commented Nov 3, 2023

@manu0466 It is ready to review

@manu0466 manu0466 merged commit b8f20ab into main Nov 9, 2023
8 checks passed
@manu0466 manu0466 deleted the paul/support-new-posts-features branch November 9, 2023 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants