Skip to content

Commit

Permalink
[test] move operations tests
Browse files Browse the repository at this point in the history
  • Loading branch information
spalmer25 committed Nov 29, 2024
1 parent 32118e0 commit 2a2a9e3
Show file tree
Hide file tree
Showing 19 changed files with 140 additions and 189 deletions.
52 changes: 0 additions & 52 deletions tests/integration/nano/test_ensure_always_clearsign.py

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright 2023 Functori <[email protected]>
# Copyright 2024 Functori <[email protected]>
# Copyright 2024 Trilitech <[email protected]>

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Check signing ballot"""
"""Gathering of tests related to Ballot operations."""

from pathlib import Path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright 2023 Functori <[email protected]>
# Copyright 2024 Functori <[email protected]>
# Copyright 2024 Trilitech <[email protected]>

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Check signing delegation"""
"""Gathering of tests related to Delegation operations."""

from pathlib import Path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright 2023 Functori <[email protected]>
# Copyright 2024 Functori <[email protected]>
# Copyright 2024 Trilitech <[email protected]>

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Check signing failing noop"""
"""Gathering of tests related to Failing-noop operations."""

from pathlib import Path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright 2023 Functori <[email protected]>
# Copyright 2024 Functori <[email protected]>
# Copyright 2024 Trilitech <[email protected]>

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Check signing increase paid storage"""
"""Gathering of tests related to Increase-paid-storage operations."""

from pathlib import Path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright 2023 Functori <[email protected]>
# Copyright 2024 Functori <[email protected]>
# Copyright 2024 Trilitech <[email protected]>

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Check signing origination"""
"""Gathering of tests related to Origination operations."""

from pathlib import Path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright 2023 Functori <[email protected]>
# Copyright 2024 Functori <[email protected]>
# Copyright 2024 Trilitech <[email protected]>

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Check signing proposals"""
"""Gathering of tests related to Proposals operations."""

from pathlib import Path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright 2023 Functori <[email protected]>
# Copyright 2024 Functori <[email protected]>
# Copyright 2024 Trilitech <[email protected]>

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Check signing register global constant"""
"""Gathering of tests related to Register-global-constant operations."""

from pathlib import Path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright 2023 Functori <[email protected]>
# Copyright 2024 Functori <[email protected]>
# Copyright 2024 Trilitech <[email protected]>

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Check signing reveal"""
"""Gathering of tests related to Reveal operations."""

from pathlib import Path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright 2023 Functori <[email protected]>
# Copyright 2024 Functori <[email protected]>
# Copyright 2024 Trilitech <[email protected]>

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Check signing smart rollup add message"""
"""Gathering of tests related to Smart-rollup Add-message operations."""

from pathlib import Path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright 2023 Functori <[email protected]>
# Copyright 2024 Functori <[email protected]>
# Copyright 2024 Trilitech <[email protected]>

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Check signing smart rollup execute outbox message"""
"""Gathering of tests related to Smart-rollup Execute-outbox operations."""

from pathlib import Path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright 2023 Functori <[email protected]>
# Copyright 2024 Functori <[email protected]>
# Copyright 2024 Trilitech <[email protected]>

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Check signing smart rollup originate"""
"""Gathering of tests related to Smart-rollup Originate operations."""

from pathlib import Path
from typing import List, Optional
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright 2023 Functori <[email protected]>
# Copyright 2024 Functori <[email protected]>
# Copyright 2024 Trilitech <[email protected]>

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Check signing set consensus key"""
"""Gathering of tests related to Set-consensus-key operations."""

from pathlib import Path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright 2023 Functori <[email protected]>
# Copyright 2024 Functori <[email protected]>
# Copyright 2024 Trilitech <[email protected]>

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Check signing set deposit limit"""
"""Gathering of tests related to Set-deposit-limit operations."""

from pathlib import Path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# Copyright 2023 Functori <[email protected]>
# Copyright 2024 Functori <[email protected]>
# Copyright 2024 Trilitech <[email protected]>

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Check signing transaction"""
"""Gathering of tests related to Transaction operations."""

from pathlib import Path

Expand Down Expand Up @@ -263,3 +264,65 @@ def test_sign_set_delegate_parameters_transaction(app: TezosAppScreen):
data=data)

app.quit()

def test_sign_with_long_hash(app: TezosAppScreen):
"""Check signing transaction with a long destination hash"""
test_name = "test_sign_with_long_hash"

app.setup_expert_mode()

message = Transaction(
source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa',
fee = 10000,
counter = 2,
gas_limit = 3,
storage_limit = 4,
destination = 'KT1GW4QHn66m7WWWMWCMNaWmGYpCRbg5ahwU',
amount = 0,
entrypoint = 'root',
parameter = {'int': 0}
)

data = app.sign(DEFAULT_ACCOUNT,
message,
with_hash=True,
path=test_name)

app.checker.check_signature(
account=DEFAULT_ACCOUNT,
message=message,
with_hash=True,
data=data)

app.quit()

def test_ensure_always_clearsign(app: TezosAppScreen):
"""Check clear signing never blindsign"""
test_name = "test_ensure_always_clearsign"

app.setup_expert_mode()

message = Transaction(
source = 'tz1ixvCiPJYyMjsp2nKBVaq54f6AdbV8hCKa',
fee = 10000,
counter = 2,
gas_limit = 3,
storage_limit = 4,
destination = 'KT18amZmM5W7qDWVt2pH6uj7sCEd3kbzLrHT',
amount = 0,
entrypoint = 'root',
parameter = [{'prim':'pair','args':[{'string':"["},{'prim':'pair','args':[{'string':"Z"},{'prim':'pair','args':[{'string':"Y"},{'prim':'pair','args':[{'string':"X"},{'prim':'pair','args':[{'string':"W"},{'prim':'pair','args':[{'string':"V"},{'prim':'pair','args':[{'string':"U"},{'prim':'pair','args':[{'string':"T"},{'prim':'pair','args':[{'string':"S"},{'prim':'pair','args':[{'string':"R"},{'prim':'pair','args':[{'string':"Q"},{'prim':'pair','args':[{'string':"P"},{'prim':'pair','args':[{'string':"O"},{'prim':'pair','args':[{'string':"N"},{'prim':'pair','args':[{'string':"M"},{'prim':'pair','args':[{'string':"L"},{'prim':'pair','args':[{'string':"K"},{'prim':'pair','args':[{'string':"J"},{'prim':'pair','args':[{'string':"I"},{'prim':'pair','args':[{'string':"H"},{'prim':'pair','args':[{'string':"G"},{'prim':'pair','args':[{'string':"F"},{'prim':'pair','args':[{'string':"E"},{'prim':'pair','args':[{'string':"D"},{'prim':'pair','args':[{'string':"C"},{'prim':'pair','args':[{'string':"B"},[]]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]},{'prim':'pair','args':[{'int':10},{'prim':'pair','args':[{'int':9},{'prim':'pair','args':[{'int':8},{'prim':'pair','args':[{'int':7},{'prim':'pair','args':[{'int':6},{'prim':'pair','args':[{'int':5},{'prim':'pair','args':[{'int':4},{'prim':'pair','args':[{'int':3},{'prim':'pair','args':[{'int':2},{'prim':'pair','args':[{'int':1},[]]}]}]}]}]}]}]}]}]}]}]
)

data = app.sign(DEFAULT_ACCOUNT,
message,
with_hash=True,
path=test_name)

app.checker.check_signature(
account=DEFAULT_ACCOUNT,
message=message,
with_hash=True,
data=data)

app.quit()
Loading

0 comments on commit 2a2a9e3

Please sign in to comment.