mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-04 09:02:28 +00:00
Add Context stack Item
This commit is contained in:
parent
04c56b514c
commit
1ff0caf40e
3 changed files with 164 additions and 0 deletions
|
@ -10,6 +10,7 @@ type Item interface {
|
|||
Boolean() (*Boolean, error)
|
||||
ByteArray() (*ByteArray, error)
|
||||
Array() (*Array, error)
|
||||
Context() (*Context, error)
|
||||
}
|
||||
|
||||
// Represents an `abstract` stack item
|
||||
|
@ -40,3 +41,9 @@ func (a *abstractItem) ByteArray() (*ByteArray, error) {
|
|||
func (a *abstractItem) Array() (*Array, error) {
|
||||
return nil, errors.New("This stack item is not an array")
|
||||
}
|
||||
|
||||
// Context is the default implementation for a stackItem
|
||||
// Implements Item interface
|
||||
func (a *abstractItem) Context() (*Context, error) {
|
||||
return nil, errors.New("This stack item is not of type context")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue