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(json-rpc): get transaction block raw effects #19438

Merged
merged 1 commit into from
Sep 18, 2024
Merged

Commits on Sep 18, 2024

  1. feat(json-rpc): get transaction block raw effects

    ## Description
    
    Add the ability to get transaction effects in BCS form, from JSON-RPC's
    read path, by passing the `showRawEffects` option.
    
    ## Test plan
    
    ```
    sui$ cargo build --bin sui --features indexer
    sui$ $SUI start --force-regenesis --with-indexer --with-graphql --with-faucet
    ```
    
    Then in another session:
    
    ```
    sui$ $SUI client faucet
    ```
    
    Find the transaction `$DIGEST` of the faucet transaction, and then fetch it
    with:
    
    ```
    curl -LX POST  "http://localhost:9000" \
            --header 'Content-Type: application/json' \
            --data-raw '{
            "jsonrpc": "2.0",
            "method": "sui_getTransactionBlock",
            "id": 1,
            "params": ["'$DIGEST'", { "showRawEffects": true }]
    }' | jq .
    ```
    
    And corroborate it against the following GraphQL query:
    
    ```
    query ($digest: String!) {
      transactionBlock(digest: $digest) {
        effects { bcs }
      }
    }
    ```
    
    Which can be requested at `localhost:9125`.
    amnn committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    100ed77 View commit details
    Browse the repository at this point in the history