Add Context stack Item

This commit is contained in:
BlockChainDev 2019-03-15 22:32:08 +00:00
parent 04c56b514c
commit 1ff0caf40e
3 changed files with 164 additions and 0 deletions

View file

@ -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")
}