Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

Commit

Permalink
fix: fix return for comparison on gas estimation
Browse files Browse the repository at this point in the history
  • Loading branch information
immortal-tofu committed Feb 28, 2024
1 parent 35bbf84 commit 6fca386
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fhevm/fhelib_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func fheLeRun(environment EVMEnvironment, caller common.Address, addr common.Add

// If we are doing gas estimation, skip execution and insert a random ciphertext as a result.
if !environment.IsCommitting() && !environment.IsEthCall() {
return importRandomCiphertext(environment, lhs.fheUintType()), nil
return importRandomCiphertext(environment, FheBool), nil
}

result, err := lhs.ciphertext.ScalarLe(rhs.Uint64())
Expand Down Expand Up @@ -336,7 +336,7 @@ func fheLtRun(environment EVMEnvironment, caller common.Address, addr common.Add

// If we are doing gas estimation, skip execution and insert a random ciphertext as a result.
if !environment.IsCommitting() && !environment.IsEthCall() {
return importRandomCiphertext(environment, lhs.fheUintType()), nil
return importRandomCiphertext(environment, FheBool), nil
}

result, err := lhs.ciphertext.ScalarLt(rhs.Uint64())
Expand Down Expand Up @@ -402,7 +402,7 @@ func fheEqRun(environment EVMEnvironment, caller common.Address, addr common.Add

// If we are doing gas estimation, skip execution and insert a random ciphertext as a result.
if !environment.IsCommitting() && !environment.IsEthCall() {
return importRandomCiphertext(environment, lhs.fheUintType()), nil
return importRandomCiphertext(environment, FheBool), nil
}

result, err := lhs.ciphertext.ScalarEq(rhs.Uint64())
Expand Down Expand Up @@ -468,7 +468,7 @@ func fheGeRun(environment EVMEnvironment, caller common.Address, addr common.Add

// If we are doing gas estimation, skip execution and insert a random ciphertext as a result.
if !environment.IsCommitting() && !environment.IsEthCall() {
return importRandomCiphertext(environment, lhs.fheUintType()), nil
return importRandomCiphertext(environment, FheBool), nil
}

result, err := lhs.ciphertext.ScalarGe(rhs.Uint64())
Expand Down Expand Up @@ -534,7 +534,7 @@ func fheGtRun(environment EVMEnvironment, caller common.Address, addr common.Add

// If we are doing gas estimation, skip execution and insert a random ciphertext as a result.
if !environment.IsCommitting() && !environment.IsEthCall() {
return importRandomCiphertext(environment, lhs.fheUintType()), nil
return importRandomCiphertext(environment, FheBool), nil
}

result, err := lhs.ciphertext.ScalarGt(rhs.Uint64())
Expand Down Expand Up @@ -732,7 +732,7 @@ func fheNeRun(environment EVMEnvironment, caller common.Address, addr common.Add

// If we are doing gas estimation, skip execution and insert a random ciphertext as a result.
if !environment.IsCommitting() && !environment.IsEthCall() {
return importRandomCiphertext(environment, lhs.fheUintType()), nil
return importRandomCiphertext(environment, FheBool), nil
}

result, err := lhs.ciphertext.ScalarNe(rhs.Uint64())
Expand Down

0 comments on commit 6fca386

Please sign in to comment.