Skip to content

Commit

Permalink
test: using more reliable function to compute y
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertoCentonze committed Apr 16, 2024
1 parent 7974330 commit 1e3619e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/utils/simulation_int_many.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@


def get_y_n2_dec(ANN, gamma, x, D, i):
"""
Analytical solution to obtain the value of y
Equivalent to get_y in the math smart contract,
except that it doesn't fallback to newton_y.
This function is a draft and should not be used
as expected value for y in testing.
"""

if i == 0:
m = 1
Expand Down Expand Up @@ -174,8 +181,7 @@ def newton_y(A, gamma, x, D, i):


def solve_x(A, gamma, x, D, i):
return int(get_y_n2_dec(A, gamma, x, D, i)[0] * 10**18)
# return newton_y(A, gamma, x, D, i)
return newton_y(A, gamma, x, D, i)


def solve_D(A, gamma, x):
Expand Down

0 comments on commit 1e3619e

Please sign in to comment.