Skip to content

Commit c1bea64

Browse files
committed
Add Cron triggers
1 parent b785cb9 commit c1bea64

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

src/HookOn.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ class HookOn
5555
const ttURITOKEN_BUY = 47;
5656
const ttURITOKEN_CREATE_SELL_OFFER = 48;
5757
const ttURITOKEN_CANCEL_SELL_OFFER = 49;
58+
const ttCRON = 92;
59+
const ttCRON_SET = 93;
5860
const ttREMARKS_SET = 94;
5961
const ttREMIT = 95;
6062
const ttGENESIS_MINT = 96; //Private
@@ -103,6 +105,8 @@ class HookOn
103105
47 => 'ttURITOKEN_BUY',
104106
48 => 'ttURITOKEN_CREATE_SELL_OFFER',
105107
49 => 'ttURITOKEN_CANCEL_SELL_OFFER',
108+
92 => 'ttCRON',
109+
93 => 'ttCRON_SET',
106110
94 => 'ttREMARKS_SET',
107111
95 => 'ttREMIT',
108112
96 => 'ttGENESIS_MINT',

tests/HookOnTest.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,11 @@ public function testDecode()
114114
$triggered = HookOn::decode($hookon,false);
115115
$this->assertEquals(254,count($triggered));
116116

117-
//ALL (public) triggers
117+
//Almost ALL (public) triggers
118118
$hookon = '0xfffffffffffffffffffffffffffffffffffffff13ffffffffffc1fffbfc00a40';
119119
$triggered = HookOn::decode($hookon);
120120
$expected = HookOn::MAP;
121+
121122
//Following are "private" triggers, as documented absent in https://richardah.github.io/xrpl-hookon-calculator
122123
unset($expected[HookOn::ttNFTOKEN_MINT]);
123124
unset($expected[HookOn::ttNFTOKEN_BURN]);
@@ -137,9 +138,13 @@ public function testDecode()
137138
unset($expected[HookOn::ttSPINAL_TAP]);
138139
//Remove "public" contract (added later)
139140
unset($expected[HookOn::ttCONTRACT]);
141+
unset($expected[HookOn::ttCRON]); //public new since 10.2025
142+
unset($expected[HookOn::ttCRON_SET]); //public new since 10.2025
143+
//dd($triggered,$expected);
144+
140145
$this->assertEquals($expected,$triggered);
141-
142-
//ALL triggers except TRUST_SET
146+
147+
//ALL triggers except ttTRUST_SET, ttCRON, and ttCRON_SET
143148
$hookon = '0xfffffffffffffffffffffffffffffffffffffff13ffffffffffc1fffbfd00a40';
144149
$triggered = HookOn::decode($hookon);
145150
$expected = HookOn::MAP;
@@ -161,9 +166,11 @@ public function testDecode()
161166
unset($expected[HookOn::ttNICKNAME_SET]);
162167
unset($expected[HookOn::ttSPINAL_TAP]);
163168

164-
//Remove "public" trust set and contract
169+
//Remove "public" trust set, contract, and cron
165170
unset($expected[HookOn::ttTRUST_SET]);
166171
unset($expected[HookOn::ttCONTRACT]);
172+
unset($expected[HookOn::ttCRON]); //public new since 10.2025
173+
unset($expected[HookOn::ttCRON_SET]); //public new since 10.2025
167174
$this->assertEquals($expected,$triggered);
168175
}
169176

0 commit comments

Comments
 (0)