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

enhancement: implement decoding for data in MessageOut #611

Merged
merged 7 commits into from
Mar 1, 2023

Conversation

deekerno
Copy link
Contributor

@deekerno deekerno commented Feb 22, 2023

Closes #300.

Changelog

  • Adds decoding for the data field on MessageOut receipts
  • Adds new entity to test schema; adjusts trigger_messageout() in Sway contract
  • Updates outdated documentation about the MessageOut receipt

Testing Plan

Added asserts to MessageOut E2E test to ensure that example message entity is stored. You can run the test and verify that it works by compiling the index and running cargo test --features e2e,postgres,pg-embed-skip test_can_trigger_and_index_messageout_event_postgres.

Manual Steps

  1. Ensure that the database is cleared.
  2. Compile the fuel-indexer-test WASM module.
  3. Start a test Fuel node: cargo run --bin fuel-node.
  4. Start the test web API: cargo run --bin web-api.
  5. Start the indexer service with the test index deployed: cargo run --bin fuel-indexer -- run --manifest packages/fuel-indexer-tests/assets/fuel_indexer_test.yaml.
  6. Generate test MessageOut data from the contract: curl -X POST http://127.0.0.1:8000/messageout.
  7. Check the indexer service logs to ensure that data is inserted into both the messageout and messageentity tables.
  8. Query the service to ensure that the message is properly returned through the GraphQL API:
curl -X POST http://127.0.0.1:29987/api/graph/fuel_indexer_test/index1 \
   -H 'content-type: application/json' \
   -d '{"query": "query { messageentity { id message } }", "params": "b"}'

@deekerno deekerno self-assigned this Feb 22, 2023
@deekerno deekerno force-pushed the deekerno/300-implement-decoding-for-messageout branch from ff47f70 to fae1b1f Compare February 23, 2023 18:49
@deekerno deekerno marked this pull request as ready for review February 23, 2023 19:17
@deekerno deekerno requested a review from ra0x3 February 23, 2023 19:17
@deekerno deekerno enabled auto-merge (squash) February 23, 2023 20:35
@deekerno deekerno force-pushed the deekerno/300-implement-decoding-for-messageout branch from 6d37539 to 075f551 Compare February 23, 2023 20:52
@@ -2,7 +2,7 @@ namespace: fuel_indexer_test
graphql_schema: packages/fuel-indexer-tests/components/indices/fuel-indexer-test/schema/fuel_indexer_test.graphql
abi: packages/fuel-indexer-tests/contracts/fuel-indexer-test/out/debug/fuel-indexer-test-abi.json
start_block: 1
contract_id: fuel1u47xjlucyjf2hkn874675fgdfue0vmyne72ucch74jcgu457rluq236j5e
contract_id: fuel1awqdupn0smn4m455xvzc5vlgds22e3pz7yrpw0gtnh9awfn39plsrzkn6p
Copy link
Contributor

Choose a reason for hiding this comment

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

👌🏽

@@ -37,7 +37,7 @@ pub mod defaults {
// the node provider for E2E tests, but spawning a task that is supposed
// to return the contract ID won't give us the ID until the task is completed.
pub const CURRENT_TEST_CONTRACT_ID_STR: &str =
"fuel1u47xjlucyjf2hkn874675fgdfue0vmyne72ucch74jcgu457rluq236j5e";
"fuel1awqdupn0smn4m455xvzc5vlgds22e3pz7yrpw0gtnh9awfn39plsrzkn6p";
Copy link
Contributor

Choose a reason for hiding this comment

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

👌🏽

Copy link
Contributor

@ra0x3 ra0x3 left a comment

Choose a reason for hiding this comment

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

Works per the testing steps :shipit:

@deekerno deekerno merged commit 2b78329 into master Mar 1, 2023
@deekerno deekerno deleted the deekerno/300-implement-decoding-for-messageout branch March 1, 2023 15:14
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.

Implement decoding for MessageOut
2 participants