@@ -111,7 +111,8 @@ func (h *Handler) Class(id BlockID, classHash felt.Felt) (*Class, *jsonrpc.Error
111111 Program : c .Program ,
112112 EntryPoints : EntryPoints {
113113 // Note that utils.Map returns nil if provided slice is nil
114- // but this is not the case here, because we rely on sn2core adapters that will set it to empty slice
114+ // but this is not the case here, because we rely on sn2core adapters
115+ // that will set it to empty slice if it's nil. In the API spec these fields are required.
115116 // if it's nil. In the API spec these fields are required.
116117 Constructor : utils .Map (c .Constructors , adaptEntryPoint ),
117118 External : utils .Map (c .Externals , adaptEntryPoint ),
@@ -132,7 +133,8 @@ func (h *Handler) Class(id BlockID, classHash felt.Felt) (*Class, *jsonrpc.Error
132133 ContractClassVersion : c .SemanticVersion ,
133134 EntryPoints : EntryPoints {
134135 // Note that utils.Map returns nil if provided slice is nil
135- // but this is not the case here, because we rely on sn2core adapters that will set it to empty slice
136+ // but this is not the case here, because we rely on sn2core adapters
137+ // that will set it to empty slice if it's nil. In the API spec these fields are required.
136138 // if it's nil. In the API spec these fields are required.
137139 Constructor : utils .Map (c .EntryPoints .Constructor , adaptEntryPoint ),
138140 External : utils .Map (c .EntryPoints .External , adaptEntryPoint ),
@@ -146,7 +148,8 @@ func (h *Handler) Class(id BlockID, classHash felt.Felt) (*Class, *jsonrpc.Error
146148 return rpcClass , nil
147149}
148150
149- // ClassAt gets the contract class definition in the given block instantiated by the given contract address
151+ // ClassAt gets the contract class definition in the given block instantiated by
152+ // the given contract address
150153//
151154// It follows the specification defined here:
152155// https://github.com/starkware-libs/starknet-specs/blob/v0.8.1/api/starknet_api_openrpc.json#L482
@@ -158,7 +161,8 @@ func (h *Handler) ClassAt(id BlockID, address felt.Felt) (*Class, *jsonrpc.Error
158161 return h .Class (id , * classHash )
159162}
160163
161- // ClassHashAt gets the class hash for the contract deployed at the given address in the given block.
164+ // ClassHashAt gets the class hash for the contract deployed at the given address
165+ // in the given block.
162166//
163167// It follows the specification defined here:
164168// https://github.com/starkware-libs/starknet-specs/blob/v0.8.1/api/starknet_api_openrpc.json#L442
0 commit comments