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 an additional "details" text area for PayPal #1032

Closed
wants to merge 3 commits into from

Conversation

wp07e
Copy link
Contributor

@wp07e wp07e commented Jun 12, 2024

#1021

This is only for Paypal accounts only. Probably need to do it for CashApp accounts as well.

Tested and verified on 1.0.7

@wp07e wp07e requested a review from woodser as a code owner June 12, 2024 17:36
wp07e and others added 2 commits June 12, 2024 18:43
@woodser woodser changed the title Add an additional "details" text area to input important trade details Add an additional "details" text area for PayPal Jun 21, 2024
@woodser
Copy link
Contributor

woodser commented Jun 24, 2024

For this and #1035, please copy as done for PayByMail or CashAtAtm.

  • The field in pb.proto is called extra_info.
  • Add PaymentAccountFormField.FieldId.EXTRA_INFO to INPUT_FIELD_IDS.
  • Uses payment.shared.optionalExtra translation.
  • Ensure the test Can validate payment account forms passes in HavenoClient.test.ts by running the API tests.

@woodser
Copy link
Contributor

woodser commented Jun 24, 2024

You can see all changes made to support extra info added to Australia PayID: https://github.com/haveno-dex/haveno/pull/994/files.

These PRs should include the same changes for extra info.

@wp07e
Copy link
Contributor Author

wp07e commented Jun 26, 2024

Thanks for the tips I'll start looking at it

@wp07e
Copy link
Contributor Author

wp07e commented Jun 26, 2024

I've tried running a basic test to get the version and I am getting this error:

`
FAIL src/HavenoClient.test.ts (18.228 s)
✕ Can get the version (CI) (2 ms)
○ skipped Can convert between XMR and atomic units (CI)
○ skipped Can manage an account (CI)
○ skipped Can manage Monero daemon connections (CI)
○ skipped Can start and stop a local Monero node (CI)
○ skipped Has a Monero wallet (CI)
○ skipped Can get balances (CI, sanity check)
○ skipped Can send and receive push notifications (CI, sanity check)
○ skipped Can get asset codes with prices and their payment methods (CI, sanity check)
○ skipped Can get market prices (CI, sanity check)
○ skipped Can get market depth (CI, sanity check)
○ skipped Can register as an arbitrator (CI)
○ skipped Can get offers (CI)
○ skipped Can get my offers (CI)
○ skipped Can get payment methods (CI)
○ skipped Can get payment accounts (CI)
○ skipped Can validate payment account forms (CI, sanity check)
○ skipped Can create fiat payment accounts (CI)
○ skipped Can create crypto payment accounts (CI)
○ skipped Can prepare for trading (CI)
○ skipped Can post and remove an offer (CI, sanity check)
○ skipped Can schedule offers with locked funds (CI)
○ skipped Can reserve exact amount needed for offer (CI)
○ skipped Cannot post offer exceeding trade limit (CI, sanity check)
○ skipped Can complete a trade within a range
○ skipped Can complete trades at the same time (CI, sanity check)
○ skipped Can complete all trade combinations (stress)
○ skipped Can go offline while completing a trade (CI, sanity check)
○ skipped Can resolve a dispute (CI)
○ skipped Can resolve disputes (CI)
○ skipped Can go offline while resolving a dispute (CI)
○ skipped Cannot make or take offer with insufficient unlocked funds (CI, sanity check)
○ skipped Invalidates offers when reserved funds are spent (CI)
○ skipped Can handle unexpected errors during trade initialization
○ skipped Selects arbitrators which are online, registered, and least used

● Can get the version (CI)

Error: Http response at 400 or 500 level, http status code: 503

  527 |     for (const settledPromise of await Promise.allSettled(promises)) {
  528 |       if (settledPromise.status === "fulfilled") startupHavenods.push((settledPromise as PromiseFulfilledResult<HavenoClient>).value);
> 529 |       else if (!err) err = new Error((settledPromise as PromiseRejectedResult).reason);
      |                            ^
  530 |     }
  531 |     if (err) throw err;
  532 |

  at Object.<anonymous> (src/HavenoClient.test.ts:529:28)

● Can get the version (CI)

TypeError: Cannot read properties of undefined (reading 'getVersion')

  578 |
  579 | test("Can get the version (CI)", async () => {
> 580 |   const version = await arbitrator.getVersion();
      |                                    ^
  581 |   expect(version).toEqual(TestConfig.haveno.version);
  582 | });
  583 |

  at Object.<anonymous> (src/HavenoClient.test.ts:580:36)

`

Do you know why? I will admit since I started working on Haveno I have caused conditions to create exceptions due to failed trades, "hash of peer's payment account payload does not match contract" exceptions, and various other exceptions but I don't believe those should effect the test correct? If necessary I can start with a clean version of haveno but this error seems unrelated.

@woodser
Copy link
Contributor

woodser commented Jun 26, 2024

Are you running the envoy proxy and funding wallet, from the instructions?

@wp07e
Copy link
Contributor Author

wp07e commented Jun 28, 2024

I think I figured it out...

Edit: Nope.

I run envoy with: sudo docker run --rm --add-host host.docker.internal:host-gateway -it -v ~/temp/github/tests/haveno-ts/config/envoy.test.yaml:/envoy.test.yaml -p 8079:8079 -p 8080:8080 -p 8081:8081 -p 8082:8082 -p 8083:8083 -p 8084:8084 -p 8085:8085 -p 8086:8086 envoyproxy/envoy-dev:latest -c /envoy.test.yaml

The last few lines from envoy are:

[2024-06-28 08:10:50.309][1][info][config] [source/server/configuration_impl.cc:154] loading stats configuration
[2024-06-28 08:10:50.309][1][warning][main] [source/server/server.cc:935] There is no configured limit to the number of allowed active downstream connections. Configure a limit in envoy.resource_monitors.downstream_connections resource monitor.
[2024-06-28 08:10:50.309][1][info][main] [source/server/server.cc:977] starting main dispatch loop
[2024-06-28 08:10:50.332][1][info][runtime] [source/common/runtime/runtime_impl.cc:625] RTDS has finished initialization
[2024-06-28 08:10:50.332][1][info][upstream] [source/common/upstream/cluster_manager_impl.cc:240] cm init: all clusters initialized
[2024-06-28 08:10:50.332][1][info][main] [source/server/server.cc:957] all clusters initialized. initializing init manager
[2024-06-28 08:10:50.332][1][info][config] [source/common/listener_manager/listener_manager_impl.cc:930] all dependencies initialized. starting workers

So seems to be working correctly.

After running make funding-wallet-local, the wallet is now being funded:

2024-06-28 08:06:31.741 W Received money: 35.108352808731, with tx: <27fb5882abcc5c89ce681dbd5952ab3b870f67f739cd0798d97bbe25b46d9d5a>
2024-06-28 08:06:31.741 W Received money: 35.108285844862, with tx:
2024-06-28 08:06:31.742 W Received money: 35.108218881121, with tx: <82669c7d1953808b700dcea7f9ef98a16a60788fb476f4949711dc75b6f1e133>
2024-06-28 08:06:31.742 W Received money: 35.108151917508, with tx: <5ab658d73cbedc4a8b5e94a8f3670524e2368d0ac84a47c89f9ba3daedcdf00a>

When I run the test, I get this output

un-28 4:11:03:81 [L0] Initializing funding wallet
Jun-28 4:11:05:61 (+2480 ms) [L0] Funding wallet balance: 34930505183738612
Jun-28 4:11:05:80 (+19 ms) [L0] Funding wallet unlocked balance: 32859013592775234
Jun-28 4:11:06:22 (+42 ms) [L0] Funding wallet height: 1144
Jun-28 4:11:06:77 (+55 ms) [L0] Funding wallet seed: origin hickory pavements tudor sizes hornet tether segments sack technical elbow unsafe legion nitrogen adapt yearbook idols fuzzy pitched goes tusks elbow erase fossil erase
Jun-28 4:11:06:84 (+7 ms) [L0] Funding wallet primary address: 9xSyMy1r9h3BVjMrF3CTqQCQy36yCfkpn7uVfMyTUbez3hhumqBUqGUNNALjcd7f1HJBRdeH82bCC3veFHW7z3xm28gug4d
Jun-28 4:11:06:84 (+0 ms) [L0] Funding wallet new subaddress: BacUFXL5nG8UsYa5er8Usr6b6FYFMix9jJrgGCTNtfdtJBHnWJoa5sKNXhMJA8hKyFgcnne1R5kYy4bV7LoyhrsyB73P2tg
Jun-28 4:11:06:82 (+198 ms) [L2] Creating Haveno client connected to http://localhost:8079
Jun-28 4:11:06:93 (+11 ms) [L2] Creating Haveno client connected to http://localhost:8080
Jun-28 4:11:06:94 (+1 ms) [L2] Creating Haveno client connected to http://localhost:8081

But I am still getting error above:
`
● Can get the version (CI)

Error: Http response at 400 or 500 level, http status code: 503

  527 |     for (const settledPromise of await Promise.allSettled(promises)) {
  528 |       if (settledPromise.status === "fulfilled") startupHavenods.push((settledPromise as PromiseFulfilledResult<HavenoClient>).value);
> 529 |       else if (!err) err = new Error((settledPromise as PromiseRejectedResult).reason);
      |                            ^
  530 |     }
  531 |     if (err) throw err;
  532 |

  at Object.<anonymous> (src/HavenoClient.test.ts:529:28)

`

I tried running the example here https://github.com/grpc/grpc-web/tree/master/net/grpc/gateway/examples/helloworld#generating-stubs to make sure 'protoc' and 'protoc-gen-grpc-web' works and I was able to produce the "_pb.js" files. So I am stumped.

@woodser
Copy link
Contributor

woodser commented Jun 28, 2024

To run the test, you'll need to have running:

  • monerod1-local
  • monerod2-local
  • funding-wallet-local
  • seednode-local
  • envoy proxy

Also first quit any running instances of java, monerod, monero-wallet-rpc, in case an old process is interfering. If everything's running correctly and nothing is interfering, the tests ought to be able to run.

Someone else has reported they had to change instances of host.docker.internal to 0.0.0.0, in case that helps.

@wp07e
Copy link
Contributor Author

wp07e commented Jun 30, 2024

I figured it out. It was envoy. You need to add --network host flag to docker run command as stated here https://stackoverflow.com/questions/69897433/envoy-upstream-connect-error-or-disconnect-reset-before-headers-reset-reason (you might want to update the instructions in the guide).

I will work on it but work may be slow until the holiday is over so just heads up

@woodser
Copy link
Contributor

woodser commented Jun 30, 2024

Thanks, I added the --network host flag: haveno-dex/haveno-ts#293

@wp07e
Copy link
Contributor Author

wp07e commented Jul 3, 2024

Hey I can prob. start working on this this weekend. Two questions:

  1. Are you planning on working on this so we don't duplicate the work?
  2. When is the next release planned for?

Thanks

@woodser
Copy link
Contributor

woodser commented Jul 4, 2024

No it would be good if you could complete it.

Next release planned for ~2 weeks from now.

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.

2 participants