Skip to content

Conversation

@rob1997
Copy link
Collaborator

@rob1997 rob1997 commented Oct 24, 2024

We're now testing samples themselves via anvil and reflection.
Removed old tests and a bunch of unused scripts in Samples.
Unity tests will fail because we're referencing workflows on main but here is a successful run for testing https://github.com/ChainSafe/web3.unity/actions/runs/11662595176

@rob1997 rob1997 self-assigned this Oct 24, 2024
@rob1997 rob1997 marked this pull request as ready for review October 31, 2024 09:22
@rob1997 rob1997 changed the title Anvil Tests Sample Tests via Foundry-Anvil Oct 31, 2024
@rob1997 rob1997 added the ready-to-merge Ready to Merge PR - this'll trigger required checks label Oct 31, 2024
@kantagara
Copy link
Contributor

@rob1997 is this Pull Request Checks / Unity Tests 🧪 / Unity Tests 🧪 (src/UnitySampleProject, PlayMode) (pull_request) Failing after 3m

Meant to fail? :D

@rob1997 rob1997 added ready-to-merge Ready to Merge PR - this'll trigger required checks and removed ready-to-merge Ready to Merge PR - this'll trigger required checks labels Oct 31, 2024
@rob1997 rob1997 force-pushed the rob/move-tests-to-anvil-625 branch 2 times, most recently from eb1fcf9 to a8562c8 Compare October 31, 2024 10:50
@rob1997 rob1997 added ready-to-merge Ready to Merge PR - this'll trigger required checks and removed ready-to-merge Ready to Merge PR - this'll trigger required checks labels Oct 31, 2024
@rob1997 rob1997 force-pushed the rob/move-tests-to-anvil-625 branch from 98b0fe8 to cd3fc46 Compare October 31, 2024 11:00
@rob1997 rob1997 force-pushed the rob/move-tests-to-anvil-625 branch from cd3fc46 to c67b94b Compare October 31, 2024 11:17
Copy link
Contributor

@creeppak creeppak left a comment

Choose a reason for hiding this comment

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

Nice job

object[] args =
{
Web3Unity.Web3.Signer.PublicAddress
Web3Unity.Instance.Address
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say Address is not descriptive enough as it can mean any address in the context of Web3Unity. Something like PlayerAddress is more suiting imo.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm I suppose yeah, this makes me think I don't think Web3Unity supports connecting multiple acoounts @kantagara what do you think of this as a feature?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it should be called PublicAddress.
In regards to multiple accounts -> That is something I think we will have to support for our upcoming partnership with you guys know who, so it will be a nice integration. Wouldn't like to use it by default tho in the main branch so to say :D

Copy link
Contributor

Choose a reason for hiding this comment

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

The name hasn't changed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep my bad, changed now

@rob1997 rob1997 force-pushed the rob/move-tests-to-anvil-625 branch from c69784d to 74b264e Compare October 31, 2024 12:46
@auto-assign auto-assign bot requested a review from sneakzttv November 4, 2024 10:51
@rob1997 rob1997 added ready-to-merge Ready to Merge PR - this'll trigger required checks and removed ready-to-merge Ready to Merge PR - this'll trigger required checks labels Nov 4, 2024
@rob1997 rob1997 force-pushed the rob/move-tests-to-anvil-625 branch 2 times, most recently from 8641c9c to f19d9c2 Compare November 4, 2024 10:53
@rob1997 rob1997 added ready-to-merge Ready to Merge PR - this'll trigger required checks and removed ready-to-merge Ready to Merge PR - this'll trigger required checks labels Nov 4, 2024
@kantagara
Copy link
Contributor

Unity tests again failing? :D

@rob1997
Copy link
Collaborator Author

rob1997 commented Nov 4, 2024

Unity tests again failing? :D

They're meant to fail because we're referencing CI on main when Tests are expecting the one on this branch, I've added a test run I did with a push trigger on main in the PRs description, once it's merged it'll get what it's expecting

@rob1997 rob1997 force-pushed the rob/move-tests-to-anvil-625 branch from 3c3cb66 to 7e4a0bb Compare November 4, 2024 11:13
@rob1997 rob1997 added ready-to-merge Ready to Merge PR - this'll trigger required checks and removed ready-to-merge Ready to Merge PR - this'll trigger required checks labels Nov 4, 2024
Copy link
Contributor

@juans-chainsafe juans-chainsafe left a comment

Choose a reason for hiding this comment

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

Things working in WebGL and iOS! Just a couple of things:

  • Remove Anvil from connection providers
Screenshot 2024-11-04 at 10 34 50 AM
  • Balance of fails if we try it without a wallet connected because is getting the balance of the current wallet:
Web3Exception: Can't get player address. No Signer was provided during construction.
ChainSafe.Gaming.Evm.Contracts.BuiltIn.Erc20Contract.EnsureSigner () (at <4e129708b90a4f2a88fe3629bf8dff3a>:0)
ChainSafe.Gaming.Evm.Contracts.BuiltIn.Erc20Contract.GetBalanceOf () (at <4e129708b90a4f2a88fe3629bf8dff3a>:0)
ChainSafe.Gaming.Evm.Contracts.BuiltIn.Erc20Service.GetBalanceOf (System.String contractAddress) (at <4e129708b90a4f2a88fe3629bf8dff3a>:0)
Erc20Sample.BalanceOf () (at Assets/Samples/web3.unity SDK/3.0.5/Web3.Unity Samples/Scripts/Samples/Erc20Sample.cs:57)
Samples.TryExecute (System.Reflection.MethodInfo method, ChainSafe.Gaming.ISample instance) (at /Users/juanmanuelspoleti/Desktop/workspace/web3.unity/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Samples/Samples.cs:92)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <606c2e0a56af495988c860a4ac613e74>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:153)
UnityEngine.UnitySynchronizationContext.Exec () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:83)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:107)

@rob1997 rob1997 force-pushed the rob/move-tests-to-anvil-625 branch from f862019 to 74a56b8 Compare November 5, 2024 09:48
@rob1997 rob1997 added ready-to-merge Ready to Merge PR - this'll trigger required checks and removed ready-to-merge Ready to Merge PR - this'll trigger required checks labels Nov 5, 2024
@rob1997
Copy link
Collaborator Author

rob1997 commented Nov 5, 2024

Things working in WebGL and iOS! Just a couple of things:

  • Remove Anvil from connection providers
Screenshot 2024-11-04 at 10 34 50 AM * Balance of fails if we try it without a wallet connected because is getting the balance of the current wallet:
Web3Exception: Can't get player address. No Signer was provided during construction.
ChainSafe.Gaming.Evm.Contracts.BuiltIn.Erc20Contract.EnsureSigner () (at <4e129708b90a4f2a88fe3629bf8dff3a>:0)
ChainSafe.Gaming.Evm.Contracts.BuiltIn.Erc20Contract.GetBalanceOf () (at <4e129708b90a4f2a88fe3629bf8dff3a>:0)
ChainSafe.Gaming.Evm.Contracts.BuiltIn.Erc20Service.GetBalanceOf (System.String contractAddress) (at <4e129708b90a4f2a88fe3629bf8dff3a>:0)
Erc20Sample.BalanceOf () (at Assets/Samples/web3.unity SDK/3.0.5/Web3.Unity Samples/Scripts/Samples/Erc20Sample.cs:57)
Samples.TryExecute (System.Reflection.MethodInfo method, ChainSafe.Gaming.ISample instance) (at /Users/juanmanuelspoleti/Desktop/workspace/web3.unity/Packages/io.chainsafe.web3-unity/Runtime/Scripts/Samples/Samples.cs:92)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <606c2e0a56af495988c860a4ac613e74>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:153)
UnityEngine.UnitySynchronizationContext.Exec () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:83)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:107)

Nice catch! requested changes made

Copy link
Contributor

@juans-chainsafe juans-chainsafe left a comment

Choose a reason for hiding this comment

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

Both issues were fixed!

Copy link
Contributor

@sneakzttv sneakzttv left a comment

Choose a reason for hiding this comment

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

solid!

@rob1997 rob1997 merged commit 7a7ca90 into main Nov 6, 2024
9 checks passed
@rob1997 rob1997 deleted the rob/move-tests-to-anvil-625 branch November 6, 2024 09:00
rob1997 added a commit that referenced this pull request Jan 16, 2025
* anvil working/integrated but tests still failing

* working sample tests

* some cleanup and refactor

* checkpoint

* checkpoint

* moved some dependencies down

* fixed async issue

* Gelato tests

* documentation and cleanup

* updated workflow to use foundry

* submodules update on checkout

* trigger on push

* log exceptions for initialize

* dependencies

* 172.17.0.1

* allowing http

* dependable dependencies and verbose connection error exception

* added --host 0.0.0.0 to anvil

* reverted dependencies and push trigger

* start and use anvil when in windows

* remove pdb meta files

* added events service adapter to Web3Unity_Tests.prefab

* resolve conflict

* merge fixed

* small edit

* requested changes made

* Duplicated Samples [skip ci]

* Sync Dependencies - Auto Commit

---------

Co-authored-by: rob1997 <rob1997@users.noreply.github.com>
Co-authored-by: Nikola Garabandic <kantagara@gmail.com>
sergeypanin1994 pushed a commit to sergeypanin1994/web3.unity that referenced this pull request Mar 16, 2025
* anvil working/integrated but tests still failing

* working sample tests

* some cleanup and refactor

* checkpoint

* checkpoint

* moved some dependencies down

* fixed async issue

* Gelato tests

* documentation and cleanup

* updated workflow to use foundry

* submodules update on checkout

* trigger on push

* log exceptions for initialize

* dependencies

* 172.17.0.1

* allowing http

* dependable dependencies and verbose connection error exception

* added --host 0.0.0.0 to anvil

* reverted dependencies and push trigger

* start and use anvil when in windows

* remove pdb meta files

* added events service adapter to Web3Unity_Tests.prefab

* resolve conflict

* merge fixed

* small edit

* requested changes made

* Duplicated Samples [skip ci]

* Sync Dependencies - Auto Commit

---------

Co-authored-by: rob1997 <rob1997@users.noreply.github.com>
Co-authored-by: Nikola Garabandic <kantagara@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Ready to Merge PR - this'll trigger required checks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants