Skip to content

Commit 1bac135

Browse files
authored
Merge pull request #10 from tinymanorg/bump-to-v3
Bump version to v3
2 parents 40cd5b9 + 4248e7d commit 1bac135

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

contracts/order/build/order_approval.teal

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
// Versioning
4949

5050
// Update this value by one with each new version
51-
#define VERSION 2
51+
#define VERSION 3
5252

5353

5454
// tl:83: router:
@@ -197,7 +197,7 @@ __func__create_application:
197197

198198
// tl:117: app_global_put(VERSION_KEY, VERSION)
199199
pushbytes VERSION_KEY // "version"
200-
pushint VERSION // 2
200+
pushint VERSION // 3
201201
app_global_put
202202

203203
// create_application(user_address,registry_app_id,vault_app_id)
@@ -303,7 +303,7 @@ __func__post_update:
303303

304304
// This will fail the update if the app is already at the same or higher version
305305
// tl:152: assert(VERSION > app_global_get(VERSION_KEY))
306-
pushint VERSION // 2
306+
pushint VERSION // 3
307307
pushbytes VERSION_KEY // "version"
308308
app_global_get
309309
>
@@ -344,11 +344,11 @@ __func__post_update:
344344
// Always update the version number in global state
345345
// tl:168: app_global_put(VERSION_KEY, VERSION)
346346
pushbytes VERSION_KEY // "version"
347-
pushint VERSION // 2
347+
pushint VERSION // 3
348348
app_global_put
349349
// tl:169: log(ARC28Event("post_update(uint64)", itob(VERSION)))
350350
pushbytes 0xfca63cfe // SHA512_256("post_update(uint64)")[:4]
351-
pushint VERSION // 2
351+
pushint VERSION // 3
352352
itob
353353
concat
354354
log
0 Bytes
Binary file not shown.

contracts/order/order_approval.tl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const int MINUTE = 60
7777
# Versioning
7878

7979
# Update this value by one with each new version
80-
const int VERSION = 2
80+
const int VERSION = 3
8181

8282

8383
router:

tests/constants.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
registry_app_local_schema = transaction.StateSchema(num_uints=8, num_byte_slices=8)
2525
registry_app_extra_pages = 3
2626

27+
MAY_1 = int(datetime(2024, 5, 1, tzinfo=timezone.utc).timestamp())
2728

2829
DAY = 86400
2930
WEEK = DAY * 7
30-
31-
MAY_1 = int(datetime(2024, 5, 1, tzinfo=timezone.utc).timestamp())
32-
3331
MAX_UINT64 = 18446744073709551615
32+
33+
CURRENT_VERSION = 3

tests/test_ordering.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from sdk.events import ordering_events, registry_events
1515
from sdk.structs import AppVersion, RecurringOrder, TriggerOrder
1616
from sdk.utils import calculate_approval_hash
17-
from tests.constants import order_approval_program, WEEK, DAY, MAX_UINT64
17+
from tests.constants import order_approval_program, WEEK, DAY, MAX_UINT64, CURRENT_VERSION
1818
from tests.core import OrderProtocolBaseTestCase
1919

2020

@@ -33,7 +33,7 @@ def test_create_order_app(self):
3333

3434
now = int(datetime.now(tz=timezone.utc).timestamp())
3535

36-
version = 2
36+
version = CURRENT_VERSION
3737
key = b"v" + version.to_bytes(8, "big")
3838
approval_hash = calculate_approval_hash(order_approval_program.bytecode)
3939
struct = AppVersion()
@@ -88,7 +88,7 @@ def test_update_order_app(self):
8888
approval_program.compile()
8989
update_bytecode = approval_program.bytecode
9090

91-
version = 2
91+
version = CURRENT_VERSION
9292
key = b"v" + version.to_bytes(8, "big")
9393
approval_hash = calculate_approval_hash(update_bytecode)
9494
struct = AppVersion()
@@ -109,16 +109,16 @@ def test_update_order_app(self):
109109
update_application_event = events[0]
110110

111111
self.assertEqual(update_application_event["user_address"], self.user_address)
112-
self.assertEqual(update_application_event["version"], 2)
112+
self.assertEqual(update_application_event["version"], CURRENT_VERSION)
113113

114114
events = decode_logs(verify_update_txn[b'dt'][b'lg'], registry_events)
115115
emited_event = events[0]
116116

117117
self.assertEqual(emited_event['event_name'], 'update_ordering_application')
118118
self.assertEqual(emited_event['order_app_id'], self.app_id)
119-
self.assertEqual(emited_event['version'], 2)
119+
self.assertEqual(emited_event['version'], CURRENT_VERSION)
120120

121-
self.assertEqual(self.ledger.get_global_state(self.app_id)[b"version"], 2)
121+
self.assertEqual(self.ledger.get_global_state(self.app_id)[b"version"], CURRENT_VERSION)
122122

123123

124124
class PutTriggerOrderTests(OrderProtocolBaseTestCase):

0 commit comments

Comments
 (0)