Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
weiihann committed Oct 18, 2024
1 parent 76b4776 commit 6a76c92
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ func (s *State) updateContractClasses(
contracts map[felt.Felt]*StateContract,
) error {
for addr, classHash := range replacedClasses {
contract, err := s.getOrCreateContract(addr, contracts)
contract, err := s.getContract(addr, contracts)
if err != nil {
return err
}
Expand All @@ -487,7 +487,7 @@ func (s *State) updateContractNonces(
contracts map[felt.Felt]*StateContract,
) error {
for addr, nonce := range nonces {
contract, err := s.getOrCreateContract(addr, contracts)
contract, err := s.getContract(addr, contracts)
if err != nil {
return err
}
Expand All @@ -509,7 +509,7 @@ func (s *State) updateContractStorages(
contracts map[felt.Felt]*StateContract,
) error {
for addr, diff := range storageDiffs {
contract, err := s.getOrCreateContract(addr, contracts)
contract, err := s.getContract(addr, contracts)
if err != nil {
if _, ok := noClassContracts[addr]; ok && errors.Is(err, ErrContractNotDeployed) {
contract = NewStateContract(&addr, noClassContractsClassHash, &felt.Zero, blockNumber)
Expand All @@ -524,7 +524,7 @@ func (s *State) updateContractStorages(
return nil
}

func (s *State) getOrCreateContract(addr felt.Felt, contracts map[felt.Felt]*StateContract) (*StateContract, error) {
func (s *State) getContract(addr felt.Felt, contracts map[felt.Felt]*StateContract) (*StateContract, error) {
contract, ok := contracts[addr]
if !ok {
var err error
Expand Down

0 comments on commit 6a76c92

Please sign in to comment.