Skip to content

Commit

Permalink
Merge pull request #24 from sei-protocol/refactor-precheck
Browse files Browse the repository at this point in the history
refactor preCheck
  • Loading branch information
codchen authored Apr 16, 2024
2 parents b95a71e + 1631249 commit d6ee041
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit d6ee041

Please sign in to comment.