Commit fcb1c145 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b5a7a5cd
......@@ -484,3 +484,50 @@ func (p *AbortTransaction) NEODecode(data []byte) (int, error) {
p.Tid = BigEndian.Uint64(data[0:])
return 8 /* + TODO variable part */, nil
}
func (p *StoreTransaction) NEODecode(data []byte) (int, error) {
p.Tid = BigEndian.Uint64(data[0:])
{
l := BigEndian.Uint32(data[8:])
data = data[12:]
if len(data) < l {
return 0, ErrDecodeOverflow
}
p.User = string(data[:l])
data = data[l:]
}
{
l := BigEndian.Uint32(data[0:])
data = data[4:]
if len(data) < l {
return 0, ErrDecodeOverflow
}
p.Description = string(data[:l])
data = data[l:]
}
{
l := BigEndian.Uint32(data[0:])
data = data[4:]
if len(data) < l {
return 0, ErrDecodeOverflow
}
p.Extension = string(data[:l])
data = data[l:]
}
{
l := BigEndian.Uint32(data[0:])
data = data[4:]
p.OidList = make([]neo.Oid, l)
for i := 0; i < l; i++ {
a := &p.OidList[i]
a = BigEndian.Uint64(data[0:])
data = data[8:]
}
}
return 0 /* + TODO variable part */, nil
}
func (p *VoteTransaction) NEODecode(data []byte) (int, error) {
p.Tid = BigEndian.Uint64(data[0:])
return 8 /* + TODO variable part */, nil
}
......@@ -442,7 +442,6 @@ type AbortTransaction struct {
Tid Tid
}
/*
// Ask to store a transaction. C -> S.
// Answer if transaction has been stored. S -> C.
type StoreTransaction struct {
......@@ -461,6 +460,7 @@ type VoteTransaction struct {
// TODO _answer = PFEmpty
}
/*
// Ask a stored object by its OID and a serial or a TID if given. If a serial
// is specified, the specified revision of an object will be returned. If
// a TID is specified, an object right before the TID will be returned. C -> S.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment