Skip to content

Commit

Permalink
CSDK/extend_transform_parsing
Browse files Browse the repository at this point in the history
Fixed naming
  • Loading branch information
ZhmakAS committed Jul 25, 2024
1 parent f4003ac commit cd49288
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions tests/types/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func Test_Transform_Package(t *testing.T) {
err = json.Unmarshal(fixture, &transform)
require.NoError(t, err)

packageRes, err := transform.Kind.ParseAsPackage()
packageRes, err := transform.Kind.ParseAsWritePackage()
require.NoError(t, err)

assert.True(t, transform.Kind.IsWritePackage())
Expand All @@ -84,7 +84,7 @@ func Test_Transform_AddressableEntity(t *testing.T) {
err = json.Unmarshal(fixture, &transform)
require.NoError(t, err)

addressableEntity, err := transform.Kind.ParseAsAddressableEntity()
addressableEntity, err := transform.Kind.ParseAsWriteAddressableEntity()
require.NoError(t, err)

assert.True(t, transform.Kind.IsWriteAddressableEntity())
Expand All @@ -103,7 +103,7 @@ func Test_Transform_BidKind(t *testing.T) {
err = json.Unmarshal(fixture, &transform)
require.NoError(t, err)

bidKind, err := transform.Kind.ParseAsBidKind()
bidKind, err := transform.Kind.ParseAsWriteBidKind()
require.NoError(t, err)

assert.True(t, transform.Kind.IsWriteBidKind())
Expand All @@ -119,7 +119,7 @@ func Test_Transform_NamedKey(t *testing.T) {
err = json.Unmarshal(fixture, &transform)
require.NoError(t, err)

namedKey, err := transform.Kind.ParseAsNamedKey()
namedKey, err := transform.Kind.ParseAsWriteNamedKey()
require.NoError(t, err)

nameCLValue, err := namedKey.Name.Value()
Expand All @@ -141,7 +141,7 @@ func Test_Transform_Message(t *testing.T) {
err = json.Unmarshal(fixture, &transform)
require.NoError(t, err)

message, err := transform.Kind.ParseAsMessage()
message, err := transform.Kind.ParseAsWriteMessage()
require.NoError(t, err)

assert.True(t, transform.Kind.IsWriteMessage())
Expand All @@ -156,7 +156,7 @@ func Test_Transform_MessageTopic(t *testing.T) {
err = json.Unmarshal(fixture, &transform)
require.NoError(t, err)

messageTopic, err := transform.Kind.ParseAsMessageTopic()
messageTopic, err := transform.Kind.ParseAsWriteMessageTopic()
require.NoError(t, err)

assert.True(t, transform.Kind.IsWriteMessageTopic())
Expand Down
12 changes: 6 additions & 6 deletions types/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (t *TransformKind) ParseAsWriteWithdraws() ([]UnbondingPurse, error) {
return jsonRes.UnbondingPurses, nil
}

func (t *TransformKind) ParseAsAddressableEntity() (*AddressableEntity, error) {
func (t *TransformKind) ParseAsWriteAddressableEntity() (*AddressableEntity, error) {
type rawData struct {
Write *struct {
AddressableEntity *AddressableEntity `json:"AddressableEntity"`
Expand All @@ -175,7 +175,7 @@ func (t *TransformKind) ParseAsAddressableEntity() (*AddressableEntity, error) {
return jsonRes.Write.AddressableEntity, nil
}

func (t *TransformKind) ParseAsPackage() (*Package, error) {
func (t *TransformKind) ParseAsWritePackage() (*Package, error) {
type rawData struct {
Write *struct {
Package *Package `json:"Package"`
Expand All @@ -194,7 +194,7 @@ func (t *TransformKind) ParseAsPackage() (*Package, error) {
return jsonRes.Write.Package, nil
}

func (t *TransformKind) ParseAsBidKind() (*BidKind, error) {
func (t *TransformKind) ParseAsWriteBidKind() (*BidKind, error) {
type rawData struct {
Write *struct {
BidKind *BidKind `json:"BidKind"`
Expand All @@ -213,7 +213,7 @@ func (t *TransformKind) ParseAsBidKind() (*BidKind, error) {
return jsonRes.Write.BidKind, nil
}

func (t *TransformKind) ParseAsNamedKey() (*NamedKeyKind, error) {
func (t *TransformKind) ParseAsWriteNamedKey() (*NamedKeyKind, error) {
type rawData struct {
Write *struct {
NamedKey *NamedKeyKind `json:"NamedKey"`
Expand All @@ -232,7 +232,7 @@ func (t *TransformKind) ParseAsNamedKey() (*NamedKeyKind, error) {
return jsonRes.Write.NamedKey, nil
}

func (t *TransformKind) ParseAsMessage() (*MessageChecksum, error) {
func (t *TransformKind) ParseAsWriteMessage() (*MessageChecksum, error) {
type rawData struct {
Write *struct {
Message *MessageChecksum `json:"Message"`
Expand All @@ -251,7 +251,7 @@ func (t *TransformKind) ParseAsMessage() (*MessageChecksum, error) {
return jsonRes.Write.Message, nil
}

func (t *TransformKind) ParseAsMessageTopic() (*MessageTopicSummary, error) {
func (t *TransformKind) ParseAsWriteMessageTopic() (*MessageTopicSummary, error) {
type rawData struct {
Write *struct {
MessageTopic *MessageTopicSummary `json:"MessageTopic"`
Expand Down

0 comments on commit cd49288

Please sign in to comment.