Skip to content

Commit b785cb9

Browse files
committed
Add two hookon field identifiers
1 parent 3d4ced2 commit b785cb9

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

src/HookOn.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class HookOn
3030
const ttNICKNAME_SET = 6; //deprecated
3131
const ttOFFER_CREATE = 7;
3232
const ttOFFER_CANCEL = 8;
33-
const ttCONTRACT = 9; //deprecated
33+
const ttCONTRACT = 9; //deprecated (removed from xahaud)
3434
const ttTICKET_CREATE = 10;
3535
const ttSPINAL_TAP = 11; //deprecated
3636
const ttSIGNER_LIST_SET = 12;
@@ -49,11 +49,13 @@ class HookOn
4949
const ttNFTOKEN_CREATE_OFFER = 27; //Private
5050
const ttNFTOKEN_CANCEL_OFFER = 28; //Private
5151
const ttNFTOKEN_ACCEPT_OFFER = 29; //Private
52+
const ttCLAWBACK = 30;
5253
const ttURITOKEN_MINT = 45;
5354
const ttURITOKEN_BURN = 46;
5455
const ttURITOKEN_BUY = 47;
5556
const ttURITOKEN_CREATE_SELL_OFFER = 48;
5657
const ttURITOKEN_CANCEL_SELL_OFFER = 49;
58+
const ttREMARKS_SET = 94;
5759
const ttREMIT = 95;
5860
const ttGENESIS_MINT = 96; //Private
5961
const ttIMPORT = 97; //Private
@@ -95,11 +97,13 @@ class HookOn
9597
27 => 'ttNFTOKEN_CREATE_OFFER',
9698
28 => 'ttNFTOKEN_CANCEL_OFFER',
9799
29 => 'ttNFTOKEN_ACCEPT_OFFER',
100+
30 => 'ttCLAWBACK',
98101
45 => 'ttURITOKEN_MINT',
99102
46 => 'ttURITOKEN_BURN',
100103
47 => 'ttURITOKEN_BUY',
101104
48 => 'ttURITOKEN_CREATE_SELL_OFFER',
102105
49 => 'ttURITOKEN_CANCEL_SELL_OFFER',
106+
94 => 'ttREMARKS_SET',
103107
95 => 'ttREMIT',
104108
96 => 'ttGENESIS_MINT',
105109
97 => 'ttIMPORT',

tests/HookOnTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function testDecode()
115115
$this->assertEquals(254,count($triggered));
116116

117117
//ALL (public) triggers
118-
$hookon = '0xfffffffffffffffffffffffffffffffffffffff7fffffffffffc1fffffc00a40';
118+
$hookon = '0xfffffffffffffffffffffffffffffffffffffff13ffffffffffc1fffbfc00a40';
119119
$triggered = HookOn::decode($hookon);
120120
$expected = HookOn::MAP;
121121
//Following are "private" triggers, as documented absent in https://richardah.github.io/xrpl-hookon-calculator
@@ -124,10 +124,10 @@ public function testDecode()
124124
unset($expected[HookOn::ttNFTOKEN_CREATE_OFFER]);
125125
unset($expected[HookOn::ttNFTOKEN_CANCEL_OFFER]);
126126
unset($expected[HookOn::ttNFTOKEN_ACCEPT_OFFER]);
127-
unset($expected[HookOn::ttREMIT]);
127+
//unset($expected[HookOn::ttREMIT]);
128128
unset($expected[HookOn::ttGENESIS_MINT]);
129-
unset($expected[HookOn::ttIMPORT]);
130-
unset($expected[HookOn::ttCLAIM_REWARD]);
129+
//unset($expected[HookOn::ttIMPORT]);
130+
//unset($expected[HookOn::ttCLAIM_REWARD]);
131131
unset($expected[HookOn::ttAMENDMENT]);
132132
unset($expected[HookOn::ttFEE]);
133133
unset($expected[HookOn::ttUNL_MODIFY]);
@@ -140,7 +140,7 @@ public function testDecode()
140140
$this->assertEquals($expected,$triggered);
141141

142142
//ALL triggers except TRUST_SET
143-
$hookon = '0xfffffffffffffffffffffffffffffffffffffff7fffffffffffc1fffffd00a40';
143+
$hookon = '0xfffffffffffffffffffffffffffffffffffffff13ffffffffffc1fffbfd00a40';
144144
$triggered = HookOn::decode($hookon);
145145
$expected = HookOn::MAP;
146146
//Following are "private" triggers, as documented absent in https://richardah.github.io/xrpl-hookon-calculator
@@ -149,10 +149,10 @@ public function testDecode()
149149
unset($expected[HookOn::ttNFTOKEN_CREATE_OFFER]);
150150
unset($expected[HookOn::ttNFTOKEN_CANCEL_OFFER]);
151151
unset($expected[HookOn::ttNFTOKEN_ACCEPT_OFFER]);
152-
unset($expected[HookOn::ttREMIT]);
152+
//unset($expected[HookOn::ttREMIT]);
153153
unset($expected[HookOn::ttGENESIS_MINT]);
154-
unset($expected[HookOn::ttIMPORT]);
155-
unset($expected[HookOn::ttCLAIM_REWARD]);
154+
//unset($expected[HookOn::ttIMPORT]);
155+
//unset($expected[HookOn::ttCLAIM_REWARD]);
156156
unset($expected[HookOn::ttAMENDMENT]);
157157
unset($expected[HookOn::ttFEE]);
158158
unset($expected[HookOn::ttUNL_MODIFY]);

0 commit comments

Comments
 (0)