core: renames entities-> state and removed State prefix
This commit is contained in:
parent
8809fe437d
commit
2d42b14a1d
31 changed files with 221 additions and 222 deletions
44
pkg/core/state/notification_event_test.go
Normal file
44
pkg/core/state/notification_event_test.go
Normal file
|
@ -0,0 +1,44 @@
|
|||
package state
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/CityOfZion/neo-go/pkg/core/testutil"
|
||||
"github.com/CityOfZion/neo-go/pkg/io"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestEncodeDecodeNotificationEvent(t *testing.T) {
|
||||
event := &NotificationEvent{
|
||||
ScriptHash: testutil.RandomUint160(),
|
||||
Item: nil,
|
||||
}
|
||||
|
||||
buf := io.NewBufBinWriter()
|
||||
event.EncodeBinary(buf.BinWriter)
|
||||
assert.Nil(t, buf.Err)
|
||||
|
||||
eventDecoded := &NotificationEvent{}
|
||||
reader := io.NewBinReaderFromBuf(buf.Bytes())
|
||||
eventDecoded.DecodeBinary(reader)
|
||||
assert.Equal(t, event, eventDecoded)
|
||||
}
|
||||
|
||||
func TestEncodeDecodeAppExecResult(t *testing.T) {
|
||||
appExecResult := &AppExecResult{
|
||||
TxHash: testutil.RandomUint256(),
|
||||
Trigger: 1,
|
||||
VMState: "Hault",
|
||||
GasConsumed: 10,
|
||||
Stack: "",
|
||||
Events: []NotificationEvent{},
|
||||
}
|
||||
buf := io.NewBufBinWriter()
|
||||
appExecResult.EncodeBinary(buf.BinWriter)
|
||||
assert.Nil(t, buf.Err)
|
||||
|
||||
appExecResultDecoded := &AppExecResult{}
|
||||
reader := io.NewBinReaderFromBuf(buf.Bytes())
|
||||
appExecResultDecoded.DecodeBinary(reader)
|
||||
assert.Equal(t, appExecResult, appExecResultDecoded)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue