Without the #[pallet::call]
macro, these functions will not have any dispatch logic which would allow an external caller to trigger the function to execute.
You will note that dispatchable calls all have a certain format like requiring the first parameter to be OriginFor<T>
and such.
Without the dispatch logic, there is no way for an incoming transaction to trigger these internal functions, unless you write your own logical paths yourselves.
In this context, the pub fn tester
is public, but only in the same way that a rust crate can expose public functions to other rust crates. This level of "public" only lives at the developer level, where we assume maximum power to do anything anyway to the runtime.
As @dastansam mentions, yes other pallets could call this function, because other pallets are also just crates, and you have made a public function accessible by Rust crates, but again, within the context of Runtime development, you can already do anything.
For example, in any pallet I could make the function:
impl<T: Config> Pallet<T> {
pub fn set_balance() {
// Set storage directly, not with `#[frame::storage]` macros / APIs.
sp_io::storage::set(key_for_account_balance, 1_000_000_000_000_000u128)
}
}
So you can see how the runtime really is just a flat set of logic to access storage, and that Pallets are just a developer abstraction to help write code better.