summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchris erway <chris.erway@algorand.com>2022-02-23 16:07:23 -0500
committerchris erway <chris.erway@algorand.com>2022-02-23 16:07:23 -0500
commite881bda02b97059624851432d3b124e64ec62ba7 (patch)
treead631b03fd6e17a5f442cc722a6fd0ee376052ea
parentd951a887d2cd94f99d075776e6a5faa4cfbe6ace (diff)
split v2 API AccountResourceModel into two types
-rw-r--r--daemon/algod/api/server/v2/handlers.go4
-rw-r--r--daemon/algod/api/spec/v2/model.go26
-rw-r--r--daemon/algod/api/spec/v2/msgp_gen.go207
-rw-r--r--daemon/algod/api/spec/v2/msgp_gen_test.go80
-rw-r--r--ledger/msgp_gen.go64
-rw-r--r--libgoal/libgoal.go4
6 files changed, 274 insertions, 111 deletions
diff --git a/daemon/algod/api/server/v2/handlers.go b/daemon/algod/api/server/v2/handlers.go
index c81e8ba8e..f4074887c 100644
--- a/daemon/algod/api/server/v2/handlers.go
+++ b/daemon/algod/api/server/v2/handlers.go
@@ -438,7 +438,7 @@ func (v2 *Handlers) AccountAssetInformation(ctx echo.Context, address string, as
// return msgpack response
if handle == protocol.CodecHandle {
- data, err := encode(handle, model.AccountResourceToAccountResourceModel(record))
+ data, err := encode(handle, model.AccountResourceToAccountAssetModel(record))
if err != nil {
return internalError(ctx, err, errFailedToEncodeResponse, v2.Log)
}
@@ -491,7 +491,7 @@ func (v2 *Handlers) AccountApplicationInformation(ctx echo.Context, address stri
// return msgpack response
if handle == protocol.CodecHandle {
- data, err := encode(handle, model.AccountResourceToAccountResourceModel(record))
+ data, err := encode(handle, model.AccountResourceToAccountApplicationModel(record))
if err != nil {
return internalError(ctx, err, errFailedToEncodeResponse, v2.Log)
}
diff --git a/daemon/algod/api/spec/v2/model.go b/daemon/algod/api/spec/v2/model.go
index 51042098c..924b50b10 100644
--- a/daemon/algod/api/spec/v2/model.go
+++ b/daemon/algod/api/spec/v2/model.go
@@ -22,25 +22,37 @@ import (
"github.com/algorand/go-algorand/ledger/ledgercore"
)
-// AccountResourceModel used to encode AccountResource
-type AccountResourceModel struct {
+// AccountAssetModel is returned by AccountAssetInformation when msgpack format is specified
+type AccountAssetModel struct {
+ _struct struct{} `codec:",omitempty,omitemptyarray"`
+
+ AssetParams basics.AssetParams `codec:"asset-params"`
+ AssetHolding basics.AssetHolding `codec:"asset-holding"`
+}
+
+// AccountAssetModel is returned by AccountApplicationInformation when msgpack format is specified
+type AccountApplicationModel struct {
_struct struct{} `codec:",omitempty,omitemptyarray"`
- AssetParams basics.AssetParams `codec:"asset-params"`
- AssetHolding basics.AssetHolding `codec:"asset-holding"`
AppLocalState basics.AppLocalState `codec:"app-local-state"`
AppParams basics.AppParams `codec:"app-params"`
}
-// AccountResourceToAccountResourceModel converts AccountResource to AccountResourceModel
-func AccountResourceToAccountResourceModel(resource ledgercore.AccountResource) AccountResourceModel {
- resourceModel := AccountResourceModel{}
+// AccountResourceToAccountAssetModel converts AccountResource to AccountAssetModel
+func AccountResourceToAccountAssetModel(resource ledgercore.AccountResource) AccountAssetModel {
+ resourceModel := AccountAssetModel{}
if resource.AssetParams != nil {
resourceModel.AssetParams = *resource.AssetParams
}
if resource.AssetHolding != nil {
resourceModel.AssetHolding = *resource.AssetHolding
}
+ return resourceModel
+}
+
+// AccountResourceToAccountApplicationModel converts AccountResource to AccountApplicationModel
+func AccountResourceToAccountApplicationModel(resource ledgercore.AccountResource) AccountApplicationModel {
+ resourceModel := AccountApplicationModel{}
if resource.AppParams != nil {
resourceModel.AppParams = *resource.AppParams
}
diff --git a/daemon/algod/api/spec/v2/msgp_gen.go b/daemon/algod/api/spec/v2/msgp_gen.go
index bd5488a3f..0a1ce27d4 100644
--- a/daemon/algod/api/spec/v2/msgp_gen.go
+++ b/daemon/algod/api/spec/v2/msgp_gen.go
@@ -7,21 +7,29 @@ import (
)
// The following msgp objects are implemented in this file:
-// AccountResourceModel
-// |-----> (*) MarshalMsg
-// |-----> (*) CanMarshalMsg
-// |-----> (*) UnmarshalMsg
-// |-----> (*) CanUnmarshalMsg
-// |-----> (*) Msgsize
-// |-----> (*) MsgIsZero
+// AccountApplicationModel
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
+//
+// AccountAssetModel
+// |-----> (*) MarshalMsg
+// |-----> (*) CanMarshalMsg
+// |-----> (*) UnmarshalMsg
+// |-----> (*) CanUnmarshalMsg
+// |-----> (*) Msgsize
+// |-----> (*) MsgIsZero
//
// MarshalMsg implements msgp.Marshaler
-func (z *AccountResourceModel) MarshalMsg(b []byte) (o []byte) {
+func (z *AccountApplicationModel) MarshalMsg(b []byte) (o []byte) {
o = msgp.Require(b, z.Msgsize())
// omitempty: check for empty values
- zb0001Len := uint32(4)
- var zb0001Mask uint8 /* 5 bits */
+ zb0001Len := uint32(2)
+ var zb0001Mask uint8 /* 3 bits */
if (*z).AppLocalState.MsgIsZero() {
zb0001Len--
zb0001Mask |= 0x2
@@ -30,14 +38,6 @@ func (z *AccountResourceModel) MarshalMsg(b []byte) (o []byte) {
zb0001Len--
zb0001Mask |= 0x4
}
- if (*z).AssetHolding.MsgIsZero() {
- zb0001Len--
- zb0001Mask |= 0x8
- }
- if (*z).AssetParams.MsgIsZero() {
- zb0001Len--
- zb0001Mask |= 0x10
- }
// variable map header, size zb0001Len
o = append(o, 0x80|uint8(zb0001Len))
if zb0001Len != 0 {
@@ -51,27 +51,17 @@ func (z *AccountResourceModel) MarshalMsg(b []byte) (o []byte) {
o = append(o, 0xaa, 0x61, 0x70, 0x70, 0x2d, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73)
o = (*z).AppParams.MarshalMsg(o)
}
- if (zb0001Mask & 0x8) == 0 { // if not empty
- // string "asset-holding"
- o = append(o, 0xad, 0x61, 0x73, 0x73, 0x65, 0x74, 0x2d, 0x68, 0x6f, 0x6c, 0x64, 0x69, 0x6e, 0x67)
- o = (*z).AssetHolding.MarshalMsg(o)
- }
- if (zb0001Mask & 0x10) == 0 { // if not empty
- // string "asset-params"
- o = append(o, 0xac, 0x61, 0x73, 0x73, 0x65, 0x74, 0x2d, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73)
- o = (*z).AssetParams.MarshalMsg(o)
- }
}
return
}
-func (_ *AccountResourceModel) CanMarshalMsg(z interface{}) bool {
- _, ok := (z).(*AccountResourceModel)
+func (_ *AccountApplicationModel) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*AccountApplicationModel)
return ok
}
// UnmarshalMsg implements msgp.Unmarshaler
-func (z *AccountResourceModel) UnmarshalMsg(bts []byte) (o []byte, err error) {
+func (z *AccountApplicationModel) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var zb0001 int
@@ -85,33 +75,146 @@ func (z *AccountResourceModel) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
if zb0001 > 0 {
zb0001--
- bts, err = (*z).AssetParams.UnmarshalMsg(bts)
+ bts, err = (*z).AppLocalState.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "AssetParams")
+ err = msgp.WrapError(err, "struct-from-array", "AppLocalState")
return
}
}
if zb0001 > 0 {
zb0001--
- bts, err = (*z).AssetHolding.UnmarshalMsg(bts)
+ bts, err = (*z).AppParams.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "AssetHolding")
+ err = msgp.WrapError(err, "struct-from-array", "AppParams")
return
}
}
if zb0001 > 0 {
+ err = msgp.ErrTooManyArrayFields(zb0001)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array")
+ return
+ }
+ }
+ } else {
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ if zb0002 {
+ (*z) = AccountApplicationModel{}
+ }
+ for zb0001 > 0 {
zb0001--
- bts, err = (*z).AppLocalState.UnmarshalMsg(bts)
+ field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "AppLocalState")
+ err = msgp.WrapError(err)
return
}
+ switch string(field) {
+ case "app-local-state":
+ bts, err = (*z).AppLocalState.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "AppLocalState")
+ return
+ }
+ case "app-params":
+ bts, err = (*z).AppParams.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "AppParams")
+ return
+ }
+ default:
+ err = msgp.ErrNoField(string(field))
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
+ }
+ }
+ }
+ }
+ o = bts
+ return
+}
+
+func (_ *AccountApplicationModel) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*AccountApplicationModel)
+ return ok
+}
+
+// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
+func (z *AccountApplicationModel) Msgsize() (s int) {
+ s = 1 + 16 + (*z).AppLocalState.Msgsize() + 11 + (*z).AppParams.Msgsize()
+ return
+}
+
+// MsgIsZero returns whether this is a zero value
+func (z *AccountApplicationModel) MsgIsZero() bool {
+ return ((*z).AppLocalState.MsgIsZero()) && ((*z).AppParams.MsgIsZero())
+}
+
+// MarshalMsg implements msgp.Marshaler
+func (z *AccountAssetModel) MarshalMsg(b []byte) (o []byte) {
+ o = msgp.Require(b, z.Msgsize())
+ // omitempty: check for empty values
+ zb0001Len := uint32(2)
+ var zb0001Mask uint8 /* 3 bits */
+ if (*z).AssetHolding.MsgIsZero() {
+ zb0001Len--
+ zb0001Mask |= 0x2
+ }
+ if (*z).AssetParams.MsgIsZero() {
+ zb0001Len--
+ zb0001Mask |= 0x4
+ }
+ // variable map header, size zb0001Len
+ o = append(o, 0x80|uint8(zb0001Len))
+ if zb0001Len != 0 {
+ if (zb0001Mask & 0x2) == 0 { // if not empty
+ // string "asset-holding"
+ o = append(o, 0xad, 0x61, 0x73, 0x73, 0x65, 0x74, 0x2d, 0x68, 0x6f, 0x6c, 0x64, 0x69, 0x6e, 0x67)
+ o = (*z).AssetHolding.MarshalMsg(o)
+ }
+ if (zb0001Mask & 0x4) == 0 { // if not empty
+ // string "asset-params"
+ o = append(o, 0xac, 0x61, 0x73, 0x73, 0x65, 0x74, 0x2d, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73)
+ o = (*z).AssetParams.MarshalMsg(o)
+ }
+ }
+ return
+}
+
+func (_ *AccountAssetModel) CanMarshalMsg(z interface{}) bool {
+ _, ok := (z).(*AccountAssetModel)
+ return ok
+}
+
+// UnmarshalMsg implements msgp.Unmarshaler
+func (z *AccountAssetModel) UnmarshalMsg(bts []byte) (o []byte, err error) {
+ var field []byte
+ _ = field
+ var zb0001 int
+ var zb0002 bool
+ zb0001, zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
+ if _, ok := err.(msgp.TypeError); ok {
+ zb0001, zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
+ if err != nil {
+ err = msgp.WrapError(err)
+ return
}
if zb0001 > 0 {
zb0001--
- bts, err = (*z).AppParams.UnmarshalMsg(bts)
+ bts, err = (*z).AssetParams.UnmarshalMsg(bts)
if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "AppParams")
+ err = msgp.WrapError(err, "struct-from-array", "AssetParams")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).AssetHolding.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "AssetHolding")
return
}
}
@@ -128,7 +231,7 @@ func (z *AccountResourceModel) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
if zb0002 {
- (*z) = AccountResourceModel{}
+ (*z) = AccountAssetModel{}
}
for zb0001 > 0 {
zb0001--
@@ -150,18 +253,6 @@ func (z *AccountResourceModel) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err, "AssetHolding")
return
}
- case "app-local-state":
- bts, err = (*z).AppLocalState.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "AppLocalState")
- return
- }
- case "app-params":
- bts, err = (*z).AppParams.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "AppParams")
- return
- }
default:
err = msgp.ErrNoField(string(field))
if err != nil {
@@ -175,18 +266,18 @@ func (z *AccountResourceModel) UnmarshalMsg(bts []byte) (o []byte, err error) {
return
}
-func (_ *AccountResourceModel) CanUnmarshalMsg(z interface{}) bool {
- _, ok := (z).(*AccountResourceModel)
+func (_ *AccountAssetModel) CanUnmarshalMsg(z interface{}) bool {
+ _, ok := (z).(*AccountAssetModel)
return ok
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
-func (z *AccountResourceModel) Msgsize() (s int) {
- s = 1 + 13 + (*z).AssetParams.Msgsize() + 14 + (*z).AssetHolding.Msgsize() + 16 + (*z).AppLocalState.Msgsize() + 11 + (*z).AppParams.Msgsize()
+func (z *AccountAssetModel) Msgsize() (s int) {
+ s = 1 + 13 + (*z).AssetParams.Msgsize() + 14 + (*z).AssetHolding.Msgsize()
return
}
// MsgIsZero returns whether this is a zero value
-func (z *AccountResourceModel) MsgIsZero() bool {
- return ((*z).AssetParams.MsgIsZero()) && ((*z).AssetHolding.MsgIsZero()) && ((*z).AppLocalState.MsgIsZero()) && ((*z).AppParams.MsgIsZero())
+func (z *AccountAssetModel) MsgIsZero() bool {
+ return ((*z).AssetParams.MsgIsZero()) && ((*z).AssetHolding.MsgIsZero())
}
diff --git a/daemon/algod/api/spec/v2/msgp_gen_test.go b/daemon/algod/api/spec/v2/msgp_gen_test.go
index e11e36d13..57bda723c 100644
--- a/daemon/algod/api/spec/v2/msgp_gen_test.go
+++ b/daemon/algod/api/spec/v2/msgp_gen_test.go
@@ -12,9 +12,9 @@ import (
"github.com/algorand/msgp/msgp"
)
-func TestMarshalUnmarshalAccountResourceModel(t *testing.T) {
+func TestMarshalUnmarshalAccountApplicationModel(t *testing.T) {
partitiontest.PartitionTest(t)
- v := AccountResourceModel{}
+ v := AccountApplicationModel{}
bts := v.MarshalMsg(nil)
left, err := v.UnmarshalMsg(bts)
if err != nil {
@@ -33,12 +33,12 @@ func TestMarshalUnmarshalAccountResourceModel(t *testing.T) {
}
}
-func TestRandomizedEncodingAccountResourceModel(t *testing.T) {
- protocol.RunEncodingTest(t, &AccountResourceModel{})
+func TestRandomizedEncodingAccountApplicationModel(t *testing.T) {
+ protocol.RunEncodingTest(t, &AccountApplicationModel{})
}
-func BenchmarkMarshalMsgAccountResourceModel(b *testing.B) {
- v := AccountResourceModel{}
+func BenchmarkMarshalMsgAccountApplicationModel(b *testing.B) {
+ v := AccountApplicationModel{}
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -46,8 +46,8 @@ func BenchmarkMarshalMsgAccountResourceModel(b *testing.B) {
}
}
-func BenchmarkAppendMsgAccountResourceModel(b *testing.B) {
- v := AccountResourceModel{}
+func BenchmarkAppendMsgAccountApplicationModel(b *testing.B) {
+ v := AccountApplicationModel{}
bts := make([]byte, 0, v.Msgsize())
bts = v.MarshalMsg(bts[0:0])
b.SetBytes(int64(len(bts)))
@@ -58,8 +58,68 @@ func BenchmarkAppendMsgAccountResourceModel(b *testing.B) {
}
}
-func BenchmarkUnmarshalAccountResourceModel(b *testing.B) {
- v := AccountResourceModel{}
+func BenchmarkUnmarshalAccountApplicationModel(b *testing.B) {
+ v := AccountApplicationModel{}
+ bts := v.MarshalMsg(nil)
+ b.ReportAllocs()
+ b.SetBytes(int64(len(bts)))
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ _, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ b.Fatal(err)
+ }
+ }
+}
+
+func TestMarshalUnmarshalAccountAssetModel(t *testing.T) {
+ partitiontest.PartitionTest(t)
+ v := AccountAssetModel{}
+ bts := v.MarshalMsg(nil)
+ left, err := v.UnmarshalMsg(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left)
+ }
+
+ left, err = msgp.Skip(bts)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(left) > 0 {
+ t.Errorf("%d bytes left over after Skip(): %q", len(left), left)
+ }
+}
+
+func TestRandomizedEncodingAccountAssetModel(t *testing.T) {
+ protocol.RunEncodingTest(t, &AccountAssetModel{})
+}
+
+func BenchmarkMarshalMsgAccountAssetModel(b *testing.B) {
+ v := AccountAssetModel{}
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ v.MarshalMsg(nil)
+ }
+}
+
+func BenchmarkAppendMsgAccountAssetModel(b *testing.B) {
+ v := AccountAssetModel{}
+ bts := make([]byte, 0, v.Msgsize())
+ bts = v.MarshalMsg(bts[0:0])
+ b.SetBytes(int64(len(bts)))
+ b.ReportAllocs()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ bts = v.MarshalMsg(bts[0:0])
+ }
+}
+
+func BenchmarkUnmarshalAccountAssetModel(b *testing.B) {
+ v := AccountAssetModel{}
bts := v.MarshalMsg(nil)
b.ReportAllocs()
b.SetBytes(int64(len(bts)))
diff --git a/ledger/msgp_gen.go b/ledger/msgp_gen.go
index 0ec2773f0..5e0a02567 100644
--- a/ledger/msgp_gen.go
+++ b/ledger/msgp_gen.go
@@ -729,14 +729,6 @@ func (z *baseAccountData) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
if zb0001 > 0 {
zb0001--
- bts, err = (*z).baseOnlineAccountData.StateProofID.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "StateProofID")
- return
- }
- }
- if zb0001 > 0 {
- zb0001--
bts, err = (*z).baseOnlineAccountData.VoteFirstValid.UnmarshalMsg(bts)
if err != nil {
err = msgp.WrapError(err, "struct-from-array", "VoteFirstValid")
@@ -761,6 +753,14 @@ func (z *baseAccountData) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
if zb0001 > 0 {
zb0001--
+ bts, err = (*z).baseOnlineAccountData.StateProofID.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "StateProofID")
+ return
+ }
+ }
+ if zb0001 > 0 {
+ zb0001--
(*z).UpdateRound, bts, err = msgp.ReadUint64Bytes(bts)
if err != nil {
err = msgp.WrapError(err, "struct-from-array", "UpdateRound")
@@ -874,12 +874,6 @@ func (z *baseAccountData) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err, "SelectionID")
return
}
- case "F":
- bts, err = (*z).baseOnlineAccountData.StateProofID.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "StateProofID")
- return
- }
case "C":
bts, err = (*z).baseOnlineAccountData.VoteFirstValid.UnmarshalMsg(bts)
if err != nil {
@@ -898,6 +892,12 @@ func (z *baseAccountData) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err, "VoteKeyDilution")
return
}
+ case "F":
+ bts, err = (*z).baseOnlineAccountData.StateProofID.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "StateProofID")
+ return
+ }
case "z":
(*z).UpdateRound, bts, err = msgp.ReadUint64Bytes(bts)
if err != nil {
@@ -924,13 +924,13 @@ func (_ *baseAccountData) CanUnmarshalMsg(z interface{}) bool {
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z *baseAccountData) Msgsize() (s int) {
- s = 3 + 2 + (*z).Status.Msgsize() + 2 + (*z).MicroAlgos.Msgsize() + 2 + msgp.Uint64Size + 2 + (*z).RewardedMicroAlgos.Msgsize() + 2 + (*z).AuthAddr.Msgsize() + 2 + msgp.Uint64Size + 2 + msgp.Uint64Size + 2 + msgp.Uint32Size + 2 + msgp.Uint64Size + 2 + msgp.Uint64Size + 2 + msgp.Uint64Size + 2 + msgp.Uint64Size + 2 + (*z).baseOnlineAccountData.VoteID.Msgsize() + 2 + (*z).baseOnlineAccountData.SelectionID.Msgsize() + 2 + (*z).baseOnlineAccountData.StateProofID.Msgsize() + 2 + (*z).baseOnlineAccountData.VoteFirstValid.Msgsize() + 2 + (*z).baseOnlineAccountData.VoteLastValid.Msgsize() + 2 + msgp.Uint64Size + 2 + msgp.Uint64Size
+ s = 3 + 2 + (*z).Status.Msgsize() + 2 + (*z).MicroAlgos.Msgsize() + 2 + msgp.Uint64Size + 2 + (*z).RewardedMicroAlgos.Msgsize() + 2 + (*z).AuthAddr.Msgsize() + 2 + msgp.Uint64Size + 2 + msgp.Uint64Size + 2 + msgp.Uint32Size + 2 + msgp.Uint64Size + 2 + msgp.Uint64Size + 2 + msgp.Uint64Size + 2 + msgp.Uint64Size + 2 + (*z).baseOnlineAccountData.VoteID.Msgsize() + 2 + (*z).baseOnlineAccountData.SelectionID.Msgsize() + 2 + (*z).baseOnlineAccountData.VoteFirstValid.Msgsize() + 2 + (*z).baseOnlineAccountData.VoteLastValid.Msgsize() + 2 + msgp.Uint64Size + 2 + (*z).baseOnlineAccountData.StateProofID.Msgsize() + 2 + msgp.Uint64Size
return
}
// MsgIsZero returns whether this is a zero value
func (z *baseAccountData) MsgIsZero() bool {
- return ((*z).Status.MsgIsZero()) && ((*z).MicroAlgos.MsgIsZero()) && ((*z).RewardsBase == 0) && ((*z).RewardedMicroAlgos.MsgIsZero()) && ((*z).AuthAddr.MsgIsZero()) && ((*z).TotalAppSchemaNumUint == 0) && ((*z).TotalAppSchemaNumByteSlice == 0) && ((*z).TotalExtraAppPages == 0) && ((*z).TotalAssetParams == 0) && ((*z).TotalAssets == 0) && ((*z).TotalAppParams == 0) && ((*z).TotalAppLocalStates == 0) && ((*z).baseOnlineAccountData.VoteID.MsgIsZero()) && ((*z).baseOnlineAccountData.SelectionID.MsgIsZero()) && ((*z).baseOnlineAccountData.StateProofID.MsgIsZero()) && ((*z).baseOnlineAccountData.VoteFirstValid.MsgIsZero()) && ((*z).baseOnlineAccountData.VoteLastValid.MsgIsZero()) && ((*z).baseOnlineAccountData.VoteKeyDilution == 0) && ((*z).UpdateRound == 0)
+ return ((*z).Status.MsgIsZero()) && ((*z).MicroAlgos.MsgIsZero()) && ((*z).RewardsBase == 0) && ((*z).RewardedMicroAlgos.MsgIsZero()) && ((*z).AuthAddr.MsgIsZero()) && ((*z).TotalAppSchemaNumUint == 0) && ((*z).TotalAppSchemaNumByteSlice == 0) && ((*z).TotalExtraAppPages == 0) && ((*z).TotalAssetParams == 0) && ((*z).TotalAssets == 0) && ((*z).TotalAppParams == 0) && ((*z).TotalAppLocalStates == 0) && ((*z).baseOnlineAccountData.VoteID.MsgIsZero()) && ((*z).baseOnlineAccountData.SelectionID.MsgIsZero()) && ((*z).baseOnlineAccountData.VoteFirstValid.MsgIsZero()) && ((*z).baseOnlineAccountData.VoteLastValid.MsgIsZero()) && ((*z).baseOnlineAccountData.VoteKeyDilution == 0) && ((*z).baseOnlineAccountData.StateProofID.MsgIsZero()) && ((*z).UpdateRound == 0)
}
// MarshalMsg implements msgp.Marshaler
@@ -1036,14 +1036,6 @@ func (z *baseOnlineAccountData) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
if zb0001 > 0 {
zb0001--
- bts, err = (*z).StateProofID.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "struct-from-array", "StateProofID")
- return
- }
- }
- if zb0001 > 0 {
- zb0001--
bts, err = (*z).VoteFirstValid.UnmarshalMsg(bts)
if err != nil {
err = msgp.WrapError(err, "struct-from-array", "VoteFirstValid")
@@ -1067,6 +1059,14 @@ func (z *baseOnlineAccountData) UnmarshalMsg(bts []byte) (o []byte, err error) {
}
}
if zb0001 > 0 {
+ zb0001--
+ bts, err = (*z).StateProofID.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "struct-from-array", "StateProofID")
+ return
+ }
+ }
+ if zb0001 > 0 {
err = msgp.ErrTooManyArrayFields(zb0001)
if err != nil {
err = msgp.WrapError(err, "struct-from-array")
@@ -1101,12 +1101,6 @@ func (z *baseOnlineAccountData) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err, "SelectionID")
return
}
- case "F":
- bts, err = (*z).StateProofID.UnmarshalMsg(bts)
- if err != nil {
- err = msgp.WrapError(err, "StateProofID")
- return
- }
case "C":
bts, err = (*z).VoteFirstValid.UnmarshalMsg(bts)
if err != nil {
@@ -1125,6 +1119,12 @@ func (z *baseOnlineAccountData) UnmarshalMsg(bts []byte) (o []byte, err error) {
err = msgp.WrapError(err, "VoteKeyDilution")
return
}
+ case "F":
+ bts, err = (*z).StateProofID.UnmarshalMsg(bts)
+ if err != nil {
+ err = msgp.WrapError(err, "StateProofID")
+ return
+ }
default:
err = msgp.ErrNoField(string(field))
if err != nil {
@@ -1145,13 +1145,13 @@ func (_ *baseOnlineAccountData) CanUnmarshalMsg(z interface{}) bool {
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z *baseOnlineAccountData) Msgsize() (s int) {
- s = 1 + 2 + (*z).VoteID.Msgsize() + 2 + (*z).SelectionID.Msgsize() + 2 + (*z).StateProofID.Msgsize() + 2 + (*z).VoteFirstValid.Msgsize() + 2 + (*z).VoteLastValid.Msgsize() + 2 + msgp.Uint64Size
+ s = 1 + 2 + (*z).VoteID.Msgsize() + 2 + (*z).SelectionID.Msgsize() + 2 + (*z).VoteFirstValid.Msgsize() + 2 + (*z).VoteLastValid.Msgsize() + 2 + msgp.Uint64Size + 2 + (*z).StateProofID.Msgsize()
return
}
// MsgIsZero returns whether this is a zero value
func (z *baseOnlineAccountData) MsgIsZero() bool {
- return ((*z).VoteID.MsgIsZero()) && ((*z).SelectionID.MsgIsZero()) && ((*z).StateProofID.MsgIsZero()) && ((*z).VoteFirstValid.MsgIsZero()) && ((*z).VoteLastValid.MsgIsZero()) && ((*z).VoteKeyDilution == 0)
+ return ((*z).VoteID.MsgIsZero()) && ((*z).SelectionID.MsgIsZero()) && ((*z).VoteFirstValid.MsgIsZero()) && ((*z).VoteLastValid.MsgIsZero()) && ((*z).VoteKeyDilution == 0) && ((*z).StateProofID.MsgIsZero())
}
// MarshalMsg implements msgp.Marshaler
diff --git a/libgoal/libgoal.go b/libgoal/libgoal.go
index 9c4fc4d62..a0107ba77 100644
--- a/libgoal/libgoal.go
+++ b/libgoal/libgoal.go
@@ -675,7 +675,7 @@ func (c *Client) AccountApplicationInformation(accountAddress string, applicatio
}
// RawAccountApplicationInformation gets account information about a given app.
-func (c *Client) RawAccountApplicationInformation(accountAddress string, applicationID uint64) (accountResource modelV2.AccountResourceModel, err error) {
+func (c *Client) RawAccountApplicationInformation(accountAddress string, applicationID uint64) (accountResource modelV2.AccountApplicationModel, err error) {
algod, err := c.ensureAlgodClient()
if err == nil {
var resp []byte
@@ -697,7 +697,7 @@ func (c *Client) AccountAssetInformation(accountAddress string, assetID uint64)
}
// RawAccountAssetInformation gets account information about a given app.
-func (c *Client) RawAccountAssetInformation(accountAddress string, assetID uint64) (accountResource modelV2.AccountResourceModel, err error) {
+func (c *Client) RawAccountAssetInformation(accountAddress string, assetID uint64) (accountResource modelV2.AccountAssetModel, err error) {
algod, err := c.ensureAlgodClient()
if err == nil {
var resp []byte