Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for dependency injection to setup #301

Merged
merged 4 commits into from
Sep 8, 2024

Conversation

ajlacey
Copy link
Collaborator

@ajlacey ajlacey commented Sep 7, 2024

This PR adds the ability to inject a setup into handlers (actually updating the handlers will be done in a follow-up PR).
It also adds support for test doubles in the setuptesting package and uses one of the doubles in the fee utils test

@ajlacey ajlacey requested review from j4qfrost and pwdel September 7, 2024 23:36
@ajlacey ajlacey linked an issue Sep 7, 2024 that may be closed by this pull request
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be good to test the struct marshaling itself by creating a yaml file and loading it? It seems a little out of scope. One benefit would be that it highlights the full workflow (i.e. load valid yaml file that gets translated to object, start app with settings).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think that makes sense. I'll put together a follow-on for that.

@j4qfrost
Copy link
Collaborator

j4qfrost commented Sep 8, 2024

transactionFee = appConfig.Economics.Betting.BetFees.BuySharesFee

BuySharesFee needs to be changed to EachBetFee, looks like this didn't carry over when you were separating the changes?

@ajlacey ajlacey merged commit 75a68ca into main Sep 8, 2024
3 checks passed
@ajlacey ajlacey deleted the feature/setup_config_dep_inj branch September 8, 2024 22:42
j4qfrost pushed a commit to j4qfrost/socialpredict that referenced this pull request Sep 12, 2024
)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)
j4qfrost added a commit that referenced this pull request Sep 15, 2024
* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

* add frontend file polling for wsl2

* add workflow files

* dependencies need backend working directory

* add macos testing

* macos

* backend test workflow

* change name

* Add test for HandleHTTPError (#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (#282)

* Creation of Market Price Projection API (#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>
j4qfrost added a commit that referenced this pull request Sep 23, 2024
* add failure condition test

* Add test for HandleHTTPError (#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (#282)

* Creation of Market Price Projection API (#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* remove wsl check

* remove watcher

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>
j4qfrost added a commit that referenced this pull request Sep 25, 2024
* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

* add frontend file polling for wsl2

* Add test for HandleHTTPError (#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (#282)

* Creation of Market Price Projection API (#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* revert

* feat(frontend): Compiles frontend into single js file for performance

* forgot merge

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>
j4qfrost added a commit to j4qfrost/socialpredict that referenced this pull request Sep 26, 2024
* add failure condition test

* Add test for HandleHTTPError (openpredictionmarkets#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (openpredictionmarkets#282)

* Creation of Market Price Projection API (openpredictionmarkets#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (openpredictionmarkets#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (openpredictionmarkets#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (openpredictionmarkets#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (openpredictionmarkets#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* remove wsl check

* remove watcher

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>
j4qfrost added a commit to j4qfrost/socialpredict that referenced this pull request Sep 26, 2024
* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

* add frontend file polling for wsl2

* Add test for HandleHTTPError (openpredictionmarkets#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (openpredictionmarkets#282)

* Creation of Market Price Projection API (openpredictionmarkets#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (openpredictionmarkets#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (openpredictionmarkets#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (openpredictionmarkets#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (openpredictionmarkets#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* revert

* feat(frontend): Compiles frontend into single js file for performance

* forgot merge

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>
j4qfrost added a commit that referenced this pull request Sep 29, 2024
* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

* add frontend file polling for wsl2

* Add test for HandleHTTPError (#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (#282)

* Creation of Market Price Projection API (#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* revert

* Fix/remove wsl check (#337)

* add failure condition test

* Add test for HandleHTTPError (#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (#282)

* Creation of Market Price Projection API (#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* remove wsl check

* remove watcher

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>

* Feature/frontend vite build (#341)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

* add frontend file polling for wsl2

* Add test for HandleHTTPError (#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (#282)

* Creation of Market Price Projection API (#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* revert

* feat(frontend): Compiles frontend into single js file for performance

* forgot merge

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>

* feat(ci): Add docker creation workflow

* separate builds

* on branch up

* main

* correct files

* remove syntax check

* fix metas

* meta access

* attestation

* separate attestations

* latest tag

* tag change

* caching

* buildx and tagging

* retag and test cache

* tagging

* automate on tags

* added back for security

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>
j4qfrost added a commit that referenced this pull request Oct 6, 2024
* add failure condition test

* Add test for HandleHTTPError (#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (#282)

* Creation of Market Price Projection API (#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* fix(ci): Doc check skip

* not

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>
j4qfrost added a commit to j4qfrost/socialpredict that referenced this pull request Oct 6, 2024
* add failure condition test

* Add test for HandleHTTPError (openpredictionmarkets#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (openpredictionmarkets#282)

* Creation of Market Price Projection API (openpredictionmarkets#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (openpredictionmarkets#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (openpredictionmarkets#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (openpredictionmarkets#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (openpredictionmarkets#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* fix(ci): Doc check skip

* not

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>
j4qfrost added a commit that referenced this pull request Oct 7, 2024
* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

* add frontend file polling for wsl2

* Add test for HandleHTTPError (#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (#282)

* Creation of Market Price Projection API (#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* revert

* Fix/remove wsl check (#337)

* add failure condition test

* Add test for HandleHTTPError (#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (#282)

* Creation of Market Price Projection API (#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* remove wsl check

* remove watcher

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>

* Feature/frontend vite build (#341)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

* add frontend file polling for wsl2

* Add test for HandleHTTPError (#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (#282)

* Creation of Market Price Projection API (#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* revert

* feat(frontend): Compiles frontend into single js file for performance

* forgot merge

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>

* feat(ci): Add docker creation workflow

* separate builds

* on branch up

* main

* correct files

* remove syntax check

* fix metas

* meta access

* attestation

* separate attestations

* latest tag

* tag change

* caching

* buildx and tagging

* retag and test cache

* tagging

* automate on tags

* added back for security

* feat(ci): Deploy workflow to staging

* squashed CI changes

* args

* Updating documentation (#362)

* Update README.md

Rewrote README to look more sales-friendly and less plain

* Update CONTRIBUTING.md

Added instructions for how to name a branch properly and added links to our Issues tab and Code of Conduct

* Refactor user model to include private fields explicitly (#353)

* Move Email and APIKey to PrivateUser fields, and embed PrivateUser into User

* Remove unused field ApiKey from test user

* Add documentation comment to ValidateTokenAndGetUser function

* Adjust instantiation of user private fields

* Remove PrivateUserResponse type for redundancy

replace it with models.PrivateUser call.
remove helper for getting private info out of the user type.
directly embed the private fields into the response.

* Refactor public user model (#354)

* Make PublicUser type and embed it into User type

* Update User instations to use the PublicUser type

* Replace PublicUserType with models.PublicUser type (#355)

* Adding Kenyon College Logo to Front Page Readme (#364)

* Adding image.

* updaing contribution guideline and readme again with kenyon name.

* Fix/ci pass doc check (#363)

* add failure condition test

* Add test for HandleHTTPError (#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (#282)

* Creation of Market Price Projection API (#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* fix(ci): Doc check skip

* not

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>

* env path

* rename deploy workflow, effective for any ssh-able target

* rename deploy workflow, effective for any ssh-able target

* fix file

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>
j4qfrost added a commit that referenced this pull request Nov 4, 2024
* add failure condition test

* Add test for HandleHTTPError (#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (#282)

* Creation of Market Price Projection API (#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* feat(ci): Setup Lighthouse

* add sources

* oops

* scheme

* only home

* hardcode

* hardcode

* no budget

* test new staging

* full staging change

* mimetypes

* merge files

* defer css loading

* force build

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>
j4qfrost added a commit that referenced this pull request Nov 4, 2024
* add failure condition test

* Add test for HandleHTTPError (#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (#282)

* Creation of Market Price Projection API (#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* feat(ci): Setup Lighthouse

* add sources

* oops

* scheme

* only home

* hardcode

* hardcode

* no budget

* test new staging

* full staging change

* mimetypes

* merge files

* defer css loading

* force build

* remove branch run

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>
astrosnat added a commit that referenced this pull request Nov 9, 2024
Fix for domain substitution

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

* add frontend file polling for wsl2

* Add test for HandleHTTPError (#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (#282)

* Creation of Market Price Projection API (#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* revert

* Fix/remove wsl check (#337)

* add failure condition test

* Add test for HandleHTTPError (#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (#282)

* Creation of Market Price Projection API (#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* remove wsl check

* remove watcher

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>

* Feature/frontend vite build (#341)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

* add frontend file polling for wsl2

* Add test for HandleHTTPError (#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (#282)

* Creation of Market Price Projection API (#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* revert

* feat(frontend): Compiles frontend into single js file for performance

* forgot merge

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>

* feat(ci): Add docker creation workflow

* separate builds

* on branch up

* main

* correct files

* remove syntax check

* fix metas

* meta access

* attestation

* separate attestations

* latest tag

* tag change

* caching

* buildx and tagging

* retag and test cache

* tagging

* automate on tags

* added back for security

* feat(ci): Deploy workflow to staging

* up version

* fingerprint check

* fingerprint remove

* fingerprint

* fingerprint

* version

* compose cmd

* input file

* go to source

* other dir

* other dir

* other dir

* var names

* check

* env file

* env file

* env file

* args

* args

* args

* args

* args

* args

* check

* backend

* backend

* docker login

* args

* fix(ci): Staging workflow not setting domain correctly

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>
j4qfrost added a commit that referenced this pull request Nov 9, 2024
* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

* add frontend file polling for wsl2

* Add test for HandleHTTPError (#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (#282)

* Creation of Market Price Projection API (#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* revert

* Fix/remove wsl check (#337)

* add failure condition test

* Add test for HandleHTTPError (#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (#282)

* Creation of Market Price Projection API (#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* remove wsl check

* remove watcher

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>

* Feature/frontend vite build (#341)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

* add frontend file polling for wsl2

* Add test for HandleHTTPError (#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* add failure condition test (#282)

* Creation of Market Price Projection API (#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <[email protected]>

* Frontend fixes (#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <[email protected]>

* Attempting toa ddress cors related security concern. (#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* revert

* feat(frontend): Compiles frontend into single js file for performance

* forgot merge

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>

* feat(ci): Add docker creation workflow

* separate builds

* on branch up

* main

* correct files

* remove syntax check

* fix metas

* meta access

* attestation

* separate attestations

* latest tag

* tag change

* caching

* buildx and tagging

* retag and test cache

* tagging

* automate on tags

* added back for security

* feat(ci): Deploy workflow to staging

* up version

* fingerprint check

* fingerprint remove

* fingerprint

* fingerprint

* version

* compose cmd

* input file

* go to source

* other dir

* other dir

* other dir

* var names

* check

* env file

* env file

* env file

* args

* args

* args

* args

* args

* args

* check

* backend

* backend

* docker login

* args

* refactor(frontend): Ran npm audit in frontend

* fix(ci): Staging workflow not setting domain correctly

* refactor(nginx): Whitelist paths

* remove file

* revert nginx change

* pulled file from upstream

---------

Co-authored-by: Osnat Katz Moon <[email protected]>
Co-authored-by: Patrick Delaney <[email protected]>
Co-authored-by: Marko Kovač <[email protected]>
Co-authored-by: Arthur <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mock Standard Test Conditions within Setup
2 participants