Skip to content

Commit 152cc0d

Browse files
fix: bug fixes in the scripts to match with test assertions
1 parent 1bf31de commit 152cc0d

File tree

12 files changed

+142
-44
lines changed

12 files changed

+142
-44
lines changed

sample/Assets/Scenes/Passport/AuthenticatedScene.unity

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,7 @@ MonoBehaviour:
12871287
m_TargetGraphic: {fileID: 66309839}
12881288
m_HandleRect: {fileID: 66309838}
12891289
m_Direction: 0
1290-
m_Value: 0
1290+
m_Value: 1
12911291
m_Size: 1
12921292
m_NumberOfSteps: 0
12931293
m_OnValueChanged:
@@ -3387,7 +3387,7 @@ MonoBehaviour:
33873387
m_TargetGraphic: {fileID: 1741513414}
33883388
m_HandleRect: {fileID: 1741513413}
33893389
m_Direction: 2
3390-
m_Value: 1
3390+
m_Value: 0
33913391
m_Size: 1
33923392
m_NumberOfSteps: 0
33933393
m_OnValueChanged:
@@ -3996,6 +3996,50 @@ MonoBehaviour:
39963996
m_Name:
39973997
m_EditorClassIdentifier:
39983998
altID: 262e4936-a89e-4025-a5b1-4b6ce7029172
3999+
--- !u!1 &996585893
4000+
GameObject:
4001+
m_ObjectHideFlags: 0
4002+
m_CorrespondingSourceObject: {fileID: 0}
4003+
m_PrefabInstance: {fileID: 0}
4004+
m_PrefabAsset: {fileID: 0}
4005+
serializedVersion: 6
4006+
m_Component:
4007+
- component: {fileID: 996585895}
4008+
- component: {fileID: 996585894}
4009+
m_Layer: 0
4010+
m_Name: AuthSceneManager
4011+
m_TagString: Untagged
4012+
m_Icon: {fileID: 0}
4013+
m_NavMeshLayer: 0
4014+
m_StaticEditorFlags: 0
4015+
m_IsActive: 1
4016+
--- !u!114 &996585894
4017+
MonoBehaviour:
4018+
m_ObjectHideFlags: 0
4019+
m_CorrespondingSourceObject: {fileID: 0}
4020+
m_PrefabInstance: {fileID: 0}
4021+
m_PrefabAsset: {fileID: 0}
4022+
m_GameObject: {fileID: 996585893}
4023+
m_Enabled: 1
4024+
m_EditorHideFlags: 0
4025+
m_Script: {fileID: 11500000, guid: 16a4ada9f04a7482bb10f6687a4a2efc, type: 3}
4026+
m_Name:
4027+
m_EditorClassIdentifier:
4028+
--- !u!4 &996585895
4029+
Transform:
4030+
m_ObjectHideFlags: 0
4031+
m_CorrespondingSourceObject: {fileID: 0}
4032+
m_PrefabInstance: {fileID: 0}
4033+
m_PrefabAsset: {fileID: 0}
4034+
m_GameObject: {fileID: 996585893}
4035+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
4036+
m_LocalPosition: {x: 431.9599, y: 422.22015, z: -14.757888}
4037+
m_LocalScale: {x: 1, y: 1, z: 1}
4038+
m_ConstrainProportionsScale: 0
4039+
m_Children: []
4040+
m_Father: {fileID: 0}
4041+
m_RootOrder: 26
4042+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
39994043
--- !u!1 &1006058933
40004044
GameObject:
40014045
m_ObjectHideFlags: 0

sample/Assets/Scenes/Passport/Imx/ImxNftTransfer.unity

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -729,8 +729,8 @@ MonoBehaviour:
729729
m_TargetGraphic: {fileID: 66309839}
730730
m_HandleRect: {fileID: 66309838}
731731
m_Direction: 0
732-
m_Value: 1
733-
m_Size: 0.99999994
732+
m_Value: 0
733+
m_Size: 1
734734
m_NumberOfSteps: 0
735735
m_OnValueChanged:
736736
m_PersistentCalls:
@@ -2255,7 +2255,7 @@ MonoBehaviour:
22552255
m_TargetGraphic: {fileID: 1741513414}
22562256
m_HandleRect: {fileID: 1741513413}
22572257
m_Direction: 2
2258-
m_Value: 1
2258+
m_Value: 0
22592259
m_Size: 1
22602260
m_NumberOfSteps: 0
22612261
m_OnValueChanged:
@@ -2804,10 +2804,10 @@ MonoBehaviour:
28042804
m_Script: {fileID: 11500000, guid: 91b840080cd8945349b79d86957b9d0b, type: 3}
28052805
m_Name:
28062806
m_EditorClassIdentifier:
2807-
clientId: MlmMouDKghn1dEbyB7GYaOLMyCLcnWMo
2808-
environment: sandbox
2809-
errorOutput: {fileID: 1253661940}
2810-
featureButtons: []
2807+
TopPadding: {fileID: 0}
2808+
Output: {fileID: 0}
2809+
UseDeviceCodeAuthButton: {fileID: 0}
2810+
UsePKCEButton: {fileID: 0}
28112811
--- !u!4 &1085794714
28122812
Transform:
28132813
m_ObjectHideFlags: 0
@@ -2873,8 +2873,8 @@ RectTransform:
28732873
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
28742874
m_AnchorMin: {x: 0, y: 0}
28752875
m_AnchorMax: {x: 0, y: 0}
2876-
m_AnchoredPosition: {x: 895.1311, y: 0}
2877-
m_SizeDelta: {x: 1790.2622, y: 0}
2876+
m_AnchoredPosition: {x: 777.4961, y: 0}
2877+
m_SizeDelta: {x: 1554.9922, y: 0}
28782878
m_Pivot: {x: 0.5, y: 0.5}
28792879
--- !u!114 &1128672539
28802880
MonoBehaviour:
@@ -4677,8 +4677,8 @@ RectTransform:
46774677
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
46784678
m_AnchorMin: {x: 0, y: 0}
46794679
m_AnchorMax: {x: 0, y: 0}
4680-
m_AnchoredPosition: {x: 895.1311, y: 0}
4681-
m_SizeDelta: {x: 1790.2622, y: 0}
4680+
m_AnchoredPosition: {x: 777.4961, y: 0}
4681+
m_SizeDelta: {x: 1554.9922, y: 0}
46824682
m_Pivot: {x: 0.5, y: 0.5}
46834683
--- !u!114 &2125223059
46844684
MonoBehaviour:

sample/Assets/Scenes/Passport/Other/SetCallTimeout.unity

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,8 @@ MonoBehaviour:
614614
m_TargetGraphic: {fileID: 66309839}
615615
m_HandleRect: {fileID: 66309838}
616616
m_Direction: 0
617-
m_Value: 1
618-
m_Size: 0.99999994
617+
m_Value: 0
618+
m_Size: 1
619619
m_NumberOfSteps: 0
620620
m_OnValueChanged:
621621
m_PersistentCalls:
@@ -838,8 +838,8 @@ RectTransform:
838838
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
839839
m_AnchorMin: {x: 0, y: 0}
840840
m_AnchorMax: {x: 0, y: 0}
841-
m_AnchoredPosition: {x: 895.1311, y: 0}
842-
m_SizeDelta: {x: 1790.2622, y: 0}
841+
m_AnchoredPosition: {x: 777.4961, y: 0}
842+
m_SizeDelta: {x: 1554.9922, y: 0}
843843
m_Pivot: {x: 0.5, y: 0.5}
844844
--- !u!114 &410008536
845845
MonoBehaviour:
@@ -1193,8 +1193,8 @@ RectTransform:
11931193
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
11941194
m_AnchorMin: {x: 0, y: 0}
11951195
m_AnchorMax: {x: 0, y: 0}
1196-
m_AnchoredPosition: {x: 895.1311, y: 0}
1197-
m_SizeDelta: {x: 1790.2622, y: 0}
1196+
m_AnchoredPosition: {x: 777.4961, y: 0}
1197+
m_SizeDelta: {x: 1554.9922, y: 0}
11981198
m_Pivot: {x: 0.5, y: 0.5}
11991199
--- !u!114 &783923066
12001200
MonoBehaviour:
@@ -1407,7 +1407,7 @@ MonoBehaviour:
14071407
m_TargetGraphic: {fileID: 1741513414}
14081408
m_HandleRect: {fileID: 1741513413}
14091409
m_Direction: 2
1410-
m_Value: 1
1410+
m_Value: 0
14111411
m_Size: 1
14121412
m_NumberOfSteps: 0
14131413
m_OnValueChanged:
@@ -2484,10 +2484,10 @@ MonoBehaviour:
24842484
m_Script: {fileID: 11500000, guid: 91b840080cd8945349b79d86957b9d0b, type: 3}
24852485
m_Name:
24862486
m_EditorClassIdentifier:
2487-
clientId: MlmMouDKghn1dEbyB7GYaOLMyCLcnWMo
2488-
environment: sandbox
2489-
errorOutput: {fileID: 1253661940}
2490-
featureButtons: []
2487+
TopPadding: {fileID: 0}
2488+
Output: {fileID: 0}
2489+
UseDeviceCodeAuthButton: {fileID: 0}
2490+
UsePKCEButton: {fileID: 0}
24912491
--- !u!4 &1258059819
24922492
Transform:
24932493
m_ObjectHideFlags: 0

sample/Assets/Scenes/Passport/SelectAuthMethod.unity

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ MonoBehaviour:
206206
m_TargetGraphic: {fileID: 416242725}
207207
m_HandleRect: {fileID: 416242724}
208208
m_Direction: 0
209-
m_Value: 0
209+
m_Value: 1
210210
m_Size: 1
211211
m_NumberOfSteps: 0
212212
m_OnValueChanged:
@@ -1717,8 +1717,8 @@ RectTransform:
17171717
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
17181718
m_AnchorMin: {x: 0, y: 0}
17191719
m_AnchorMax: {x: 0, y: 0}
1720-
m_AnchoredPosition: {x: 852.55914, y: 0}
1721-
m_SizeDelta: {x: 1665.1183, y: 0}
1720+
m_AnchoredPosition: {x: 845.9838, y: 0}
1721+
m_SizeDelta: {x: 1651.9677, y: 0}
17221722
m_Pivot: {x: 0.5, y: 0.5}
17231723
--- !u!114 &1661390145
17241724
MonoBehaviour:
@@ -1812,8 +1812,8 @@ RectTransform:
18121812
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
18131813
m_AnchorMin: {x: 0, y: 0}
18141814
m_AnchorMax: {x: 0, y: 0}
1815-
m_AnchoredPosition: {x: 852.55914, y: 0}
1816-
m_SizeDelta: {x: 1665.1183, y: 0}
1815+
m_AnchoredPosition: {x: 845.9838, y: 0}
1816+
m_SizeDelta: {x: 1651.9677, y: 0}
18171817
m_Pivot: {x: 0.5, y: 0.5}
18181818
--- !u!114 &1688502349
18191819
MonoBehaviour:

sample/Assets/Scripts/Passport/DeviceCodeLogin/DeviceCodeLoginScript.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ private async UniTaskVoid StartDeviceCodeLoginAsync()
5252

5353
private long? GetDeviceCodeTimeoutMs()
5454
{
55-
return string.IsNullOrEmpty(deviceCodeTimeoutMs?.text) ? 10000 : long.Parse(deviceCodeTimeoutMs.text); // 10 seconds default
55+
return string.IsNullOrEmpty(deviceCodeTimeoutMs?.text) ? 0 : long.Parse(deviceCodeTimeoutMs.text);
5656
}
5757

5858
private void ShowOutput(string message)

sample/Assets/Scripts/Passport/ImxIsRegisteredOffchain/ImxIsRegisteredOffchainScript.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ private async UniTaskVoid CheckIsRegisteredOffchainAsync()
3838

3939
if (isRegistered)
4040
{
41-
ShowOutput("User is registered offchain.");
41+
ShowOutput("Registered");
4242
}
4343
else
4444
{
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
using UnityEngine;
2+
using UnityEngine.SceneManagement;
3+
4+
public class AuthenticatedSceneNavigation : MonoBehaviour
5+
{
6+
// zkEVM Features
7+
public void ShowZkEvmGetBalance()
8+
{
9+
SceneManager.LoadScene("ZkEvmGetBalance");
10+
}
11+
12+
public void ShowZkEvmSendTransaction()
13+
{
14+
SceneManager.LoadScene("ZkEvmSendTransaction");
15+
}
16+
17+
public void ShowZkEvmGetTransactionReceipt()
18+
{
19+
SceneManager.LoadScene("ZkEvmGetTransactionReceipt");
20+
}
21+
22+
public void ShowZkEvmSignTypedData()
23+
{
24+
SceneManager.LoadScene("ZkEvmSignTypedData");
25+
}
26+
27+
public void ShowZkEvmRequestAccounts()
28+
{
29+
SceneManager.LoadScene("ZkEvmRequestAccounts");
30+
}
31+
32+
// IMX Features
33+
public void ShowImxNftTransfer()
34+
{
35+
SceneManager.LoadScene("ImxNftTransfer");
36+
}
37+
38+
public void ShowSetCallTimeout()
39+
{
40+
SceneManager.LoadScene("SetCallTimeout");
41+
}
42+
// Add more navigation methods as needed for other features
43+
}

sample/Assets/Scripts/Passport/Other/AuthenticatedSceneNavigation.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sample/Assets/Scripts/Passport/Reconnect/ReconnectScript.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ private async UniTaskVoid ReconnectAsync()
2929
bool connected = await Passport.Instance.ConnectImx(useCachedSession: true);
3030
if (connected)
3131
{
32+
// Set IMX and zkEVM state and update UI as if user clicked Connect to IMX/EVM
33+
SampleAppManager.IsConnectedToImx = true;
34+
SampleAppManager.IsConnectedToZkEvm = true;
35+
SampleAppManager.PassportInstance = Passport.Instance;
36+
var sceneManager = GameObject.FindObjectOfType<AuthenticatedSceneManager>();
37+
if (sceneManager != null)
38+
{
39+
sceneManager.UpdateImxButtonStates();
40+
sceneManager.UpdateZkEvmButtonStates();
41+
}
3242
NavigateToAuthenticatedScene();
3343
}
3444
else

sample/Assets/Scripts/Passport/ZkEvmConnect/ZkEvmConnectScript.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@ public class ZkEvmConnectScript : MonoBehaviour
1212
public Button connectButton;
1313
public Text output;
1414

15-
// Optionally remove Start() if wiring up in Inspector
16-
// private void Start()
17-
// {
18-
// if (connectButton != null)
19-
// {
20-
// connectButton.onClick.RemoveAllListeners();
21-
// connectButton.onClick.AddListener(() => { ConnectZkEvmAsync().Forget(); });
22-
// }
23-
// }
24-
2515
public void ConnectZkEvm()
2616
{
2717
ConnectZkEvmAsync().Forget();
@@ -55,7 +45,7 @@ private async UniTaskVoid ConnectZkEvmAsync()
5545
Debug.LogWarning("Could not find AuthenticatedSceneManager to update button states");
5646
}
5747

58-
ShowOutput("Connected to zkEVM");
48+
ShowOutput("Connected to EVM");
5949
}
6050
catch (System.Exception ex)
6151
{

0 commit comments

Comments
 (0)