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

input_parameter display of init_transactions #303

Open
DOBEN opened this issue Nov 22, 2024 · 1 comment
Open

input_parameter display of init_transactions #303

DOBEN opened this issue Nov 22, 2024 · 1 comment
Labels
[Type] Task An additional feature or improvement.

Comments

@DOBEN
Copy link
Member

DOBEN commented Nov 22, 2024

Task description
The current CCDScan (as well as other tooling Concordium/concordium-client#291) doesn't display the input_parameter/message for init_transactions. The reason is that the ContractInitializedEvent from the node doesn't expose the value so this edge case was not handled previously. https://developer.concordium.software/concordium-grpc-api/#concordium.v2.ContractInitializedEvent

In contrast, contract_update_transactions have the input_parameter available in the event.
https://developer.concordium.software/concordium-grpc-api/#concordium.v2.InstanceUpdatedEvent

Tasks:

Expand the CCDScan backend logic to extract the input_parameter/message e.g. via the SDK (not from the event) for init_transactions. Expand the frontend to display the input_parameter/message for init_transactions as well:

Back-end functions:

#[ComplexObject]
impl ContractInitialized {
    // TODO: the send message/input parameter is missing and not exposed by the event of the node currently.
    async fn message(&self) -> ApiResult<String> {
    
        // TODO: decode `self.input_parameter` with the schema.

        Ok(input_parameter_decoded)
    }

    // TODO: the send message/input parameter is missing and not exposed by the event of the node currently.
    async fn message_as_hex(&self) -> ApiResult<String> {
        Ok(hex::encode(self.input_parameter))
    }
    ...
}
@DOBEN DOBEN added the [Type] Task An additional feature or improvement. label Nov 22, 2024
@DOBEN
Copy link
Member Author

DOBEN commented Nov 27, 2024

Related PRs that expose the parameter in the ContractInitializedEvent:
Concordium/concordium-base#577
Concordium/concordium-node#1261

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Task An additional feature or improvement.
Projects
None yet
Development

No branches or pull requests

1 participant