You should review how generics work in Rust.
By defining RawOrigin
as pub enum RawOrigin<AccountId>
, we allow this enum object to work for any generic AccountId
type.
What you seem to want actually is defined in the frame_system
pallet elsewhere:
/// Exposed trait-generic origin type.
#[pallet::origin]
pub type Origin<T> = RawOrigin<<T as Config>::AccountId>;
Here you can see we take this RawOrigin
type, and directly use the AccountId
definition from Config
as you wanted.
However, doing it this way takes advantage of the #[pallet::origin]
macro, which allows pallets to register new origins in the Substrate runtime, rather than making some hard coded assumptions about this kind of thing.
So this is a very intended abstraction, and part of the overall modular design of Substrate.