From 9b110d43177653f0c886ef0d6d7e4a706b6d860a Mon Sep 17 00:00:00 2001 From: gaetbout Date: Mon, 5 Aug 2024 17:38:36 +0200 Subject: [PATCH] deprecated list-trait --- packages/storage/src/list.cairo | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/storage/src/list.cairo b/packages/storage/src/list.cairo index 18164010..d4d29985 100644 --- a/packages/storage/src/list.cairo +++ b/packages/storage/src/list.cairo @@ -1,3 +1,4 @@ +use core::ops::index::IndexView; use core::poseidon::poseidon_hash_span; use core::traits::DivRem; use starknet::storage_access::{ @@ -14,6 +15,9 @@ pub struct List { len: u32, // number of elements in array } +#[deprecated( + feature: "deprecated-list-trait", note: "Use `starknet::storage::Vec`.", since: "2.7.0" +)] pub trait ListTrait { /// Instantiates a new List with the given base address. /// @@ -272,7 +276,9 @@ impl ListImpl, +Drop, +Store> of ListTrait { } } -impl AListIndexViewImpl, +Drop, +Store> of IndexView, u32, T> { +impl AListIndexViewImpl, +Drop, +Store> of IndexView, u32> { + type Target = T; + fn index(self: @List, index: u32) -> T { self.get(index).expect('read syscall failed').expect('List index out of bounds') }