Merge pull request #24 from sei-protocol/refactor-precheck

refactor preCheck
This commit is contained in:
codchen 2024-04-16 11:33:32 +08:00 committed by GitHub
commit d6ee041f53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -276,7 +276,7 @@ func (st *StateTransition) initGas() error {
return nil
}
func (st *StateTransition) preCheck() error {
func (st *StateTransition) StatelessChecks() error {
// Only check transactions that are not fake
msg := st.msg
if !msg.SkipAccountChecks {
@ -351,7 +351,14 @@ func (st *StateTransition) preCheck() error {
}
}
}
return nil
}
func (st *StateTransition) preCheck() error {
if !st.feeCharged {
if err := st.StatelessChecks(); err != nil {
return err
}
if err := st.BuyGas(); err != nil {
return err
}