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

test: kakarot #1260

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

test: kakarot #1260

wants to merge 5 commits into from

Conversation

greged93
Copy link

Kakarot testing in SiR

Description

Adds a simple EVM contract execution using Kakarot in the integration tests from SiR.

Description of the pull request changes and motivation.

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.

src/utils.rs Outdated
Comment on lines 125 to 130
let mut output = [0; 32];

let bytes = value.to_bytes_be();
output[32 - bytes.len()..].copy_from_slice(&bytes);
output[..].copy_from_slice(&bytes);

ClassHash(output)
Copy link
Member

Choose a reason for hiding this comment

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

I think you could even just do this:

pub fn felt_to_hash(value: &Felt252) -> ClassHash {
    ClassHash(value.to_bytes_be())
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants