@@ -17,6 +17,7 @@ use starknet_types_core::felt::Felt;
17
17
18
18
use crate :: hint_processor:: execution_helper:: OsExecutionHelper ;
19
19
use crate :: hints:: enum_definition:: AllHints ;
20
+ use crate :: hints:: error:: OsHintError ;
20
21
use crate :: hints:: types:: { HintArgs , HintEnum , HintExtensionImplementation , HintImplementation } ;
21
22
#[ cfg( any( feature = "testing" , test) ) ]
22
23
use crate :: io:: os_input:: StarknetOsInput ;
@@ -29,6 +30,9 @@ pub struct SnosHintProcessor<S: StateReader> {
29
30
pub execution_helper : OsExecutionHelper < S > ,
30
31
pub syscall_hint_processor : SyscallHintProcessor ,
31
32
_deprecated_syscall_hint_processor : DeprecatedSyscallHintProcessor ,
33
+
34
+ // KZG fields.
35
+ da_segment : Option < Vec < Felt > > ,
32
36
}
33
37
34
38
impl < S : StateReader > SnosHintProcessor < S > {
@@ -41,8 +45,22 @@ impl<S: StateReader> SnosHintProcessor<S> {
41
45
execution_helper,
42
46
syscall_hint_processor,
43
47
_deprecated_syscall_hint_processor : deprecated_syscall_hint_processor,
48
+ da_segment : None ,
44
49
}
45
50
}
51
+
52
+ /// Stores the data-availabilty segment, to be used for computing the KZG commitment in blob
53
+ /// mode.
54
+ #[ allow( dead_code) ]
55
+ pub ( crate ) fn set_da_segment ( & mut self , da_segment : Vec < Felt > ) -> Result < ( ) , OsHintError > {
56
+ if self . da_segment . is_some ( ) {
57
+ return Err ( OsHintError :: AssertionFailed {
58
+ message : "DA segment is already initialized." . to_string ( ) ,
59
+ } ) ;
60
+ }
61
+ self . da_segment = Some ( da_segment) ;
62
+ Ok ( ( ) )
63
+ }
46
64
}
47
65
48
66
impl < S : StateReader > HintProcessorLogic for SnosHintProcessor < S > {
0 commit comments