Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

[RPCStateReader] Add a test calling a contract that uses keccak in testnet #907

@juanbono

Description

@juanbono

We should declare and deploy a simple contract calling the Keccak syscall and running it with our RPCStateReader.

Setup

To do this we can write a simple Cairo 2 contract that calls keccak. Declare it on testnet, deploy it and then invoke it using starkli.
To see how to use starkli to do this take a look at the tutorial: https://book.starkli.rs/tutorials/starkli-101

After doing that we should have an executed transaction on testnet. Take note of its transaction hash and block.

Test the execution of the contract

So now we can replay its execution using the RPC State Reader inside starknet in rust.

To do that take a look at the following example tests from that crate:

The goal of the test from this ticket should be to compare:

  • Fees (as in the first example)
  • Return data (retdata). We should basically test that the result is the same. This can be checked comparing the retdata field of the TransactionExecutionInfo obtained with starknet in rust and the value from the TransactionReceipt (the one returned by the execute_tx function).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions