From a15948588ecadbc446aaac764b452756ef6291ce Mon Sep 17 00:00:00 2001 From: petscheit Date: Thu, 3 Oct 2024 13:02:56 +0200 Subject: [PATCH 1/4] feat: add missing timestamp function --- cairo/src/memorizer/header_memorizer.cairo | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cairo/src/memorizer/header_memorizer.cairo b/cairo/src/memorizer/header_memorizer.cairo index 57113fc2..3b1c6005 100644 --- a/cairo/src/memorizer/header_memorizer.cairo +++ b/cairo/src/memorizer/header_memorizer.cairo @@ -133,6 +133,16 @@ pub impl HeaderMemorizerImpl of HeaderMemorizerTrait { .unwrap_syscall(); u256 { low: (*value[0]).try_into().unwrap(), high: (*value[1]).try_into().unwrap() } } + fn get_timestamp(self: @Memorizer, key: HeaderKey) -> u256 { + let value = call_contract_syscall( + HEADER_MEMORIZER.try_into().unwrap(), + HEADER_MEMORIZER_GET_TIMESTAMP, + array![*self.dict.segment_index, *self.dict.offset, key.chain_id, key.block_number,] + .span() + ) + .unwrap_syscall(); + u256 { low: (*value[0]).try_into().unwrap(), high: (*value[1]).try_into().unwrap() } + } fn get_mix_hash(self: @Memorizer, key: HeaderKey) -> u256 { let value = call_contract_syscall( HEADER_MEMORIZER.try_into().unwrap(), From 87b10243b941ca03301a713c678bc7eee701b86e Mon Sep 17 00:00:00 2001 From: petscheit Date: Thu, 3 Oct 2024 13:19:07 +0200 Subject: [PATCH 2/4] fix: failing test --- tests/python/test_tx_decoding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/test_tx_decoding.py b/tests/python/test_tx_decoding.py index a948f7fa..caaaa75c 100644 --- a/tests/python/test_tx_decoding.py +++ b/tests/python/test_tx_decoding.py @@ -37,7 +37,7 @@ def fetch_tx(tx_hash): def fetch_transaction_dict(tx_hash): tx = fetch_tx(tx_hash) - assert tx_hash == "0x" + tx.hash().hex(), "TX hashes do not match!" + assert tx_hash == tx.hash().hex(), "TX hashes do not match!" rlp = bytes_to_8_bytes_chunks_little(tx.raw_rlp()) tx_dict = { "rlp": rlp, From 1ed7ae4d444d0d28ee583cc502015163216d81f8 Mon Sep 17 00:00:00 2001 From: Pia Date: Thu, 3 Oct 2024 10:47:45 -0700 Subject: [PATCH 3/4] for now use hotfixed fixture --- tools/make/full_flow_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/make/full_flow_test.sh b/tools/make/full_flow_test.sh index d2d9e199..d0d7e072 100755 --- a/tools/make/full_flow_test.sh +++ b/tools/make/full_flow_test.sh @@ -39,7 +39,7 @@ cairo-compile --cairo_path="packages/eth_essentials" "src/hdp.cairo" --output "b # Clone the repository if the directory doesn't exist if [ ! -d "hdp-test" ]; then - git clone https://github.com/HerodotusDev/hdp-test + git clone https://github.com/HerodotusDev/hdp-test && git checkout hotfix-0.6.0 fi echo "Starting tests..." From ffe01f201288591bceec86cd57136d7b89ad3a4e Mon Sep 17 00:00:00 2001 From: Pia Date: Thu, 3 Oct 2024 10:58:14 -0700 Subject: [PATCH 4/4] fix: git path --- tools/make/full_flow_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/make/full_flow_test.sh b/tools/make/full_flow_test.sh index d0d7e072..c2c05842 100755 --- a/tools/make/full_flow_test.sh +++ b/tools/make/full_flow_test.sh @@ -39,7 +39,7 @@ cairo-compile --cairo_path="packages/eth_essentials" "src/hdp.cairo" --output "b # Clone the repository if the directory doesn't exist if [ ! -d "hdp-test" ]; then - git clone https://github.com/HerodotusDev/hdp-test && git checkout hotfix-0.6.0 + git clone https://github.com/HerodotusDev/hdp-test && cd hdp-test && git checkout hotfix-0.6.0 && cd .. fi echo "Starting tests..."