2.0 updates (#15580)

* add names for new error codes (from chia_rs)

* add constant for SOFTFORK condition opcode

* add chialisp constant for SOFTFORK condition
This commit is contained in:
Arvid Norberg 2023-06-22 14:08:34 +02:00 committed by GitHub
parent 2d437c6aa5
commit 3d94d3a7ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions

View File

@ -55,6 +55,10 @@ class ConditionOpcode(bytes, enum.Enum):
ASSERT_BEFORE_HEIGHT_RELATIVE = bytes([86])
ASSERT_BEFORE_HEIGHT_ABSOLUTE = bytes([87])
# to be activated with the 2.0 hard fork.
# the first parameter is always the cost of the condition
SOFTFORK = bytes([90])
# A condition that is always true and always ignore all arguments
REMARK = bytes([1])

View File

@ -175,6 +175,15 @@ class Err(Enum):
ASSERT_EPHEMERAL_FAILED = 140
EPHEMERAL_RELATIVE_CONDITION = 141
# raised if a SOFTFORK condition invokes an unknown extension in mempool
# mode
INVALID_SOFTFORK_CONDITION = 142
# raised if the first argument to the SOFTFORK condition is not a valid
# cost. e.g. negative or > UINT64 MAX
INVALID_SOFTFORK_COST = 143
# raised if a spend issues too many assert spend, assert puzzle,
# assert announcement or create announcement
TOO_MANY_ANNOUNCEMENTS = 144
class ValidationError(Exception):

View File

@ -56,4 +56,8 @@
; A condition that is always true and always ignore all arguments
(defconstant REMARK 1)
; A condition whose first argument specifies its cost, but is unkown otherwise
; It's a place-holder for soft-forking in new conditions
(defconstant SOFTFORK 90)
)