Skip to content

Commit

Permalink
fix(TCK): Changed account transaction int64 params to string (#1216)
Browse files Browse the repository at this point in the history
Signed-off-by: ivaylogarnev-limechain <ivaylo.garnev@limechain.tech>
  • Loading branch information
ivaylogarnev-limechain authored Jan 15, 2025
1 parent 1fe6c07 commit 37f8c41
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 20 deletions.
8 changes: 4 additions & 4 deletions tck/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ require (
github.com/rs/zerolog v1.33.0 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
google.golang.org/grpc v1.65.0 // indirect
google.golang.org/protobuf v1.36.1 // indirect
google.golang.org/protobuf v1.36.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
16 changes: 8 additions & 8 deletions tck/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,29 @@ github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc=
google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ=
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU=
google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
Expand Down
26 changes: 22 additions & 4 deletions tck/methods/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package methods

import (
"context"
"strconv"
"time"

"github.com/hiero-ledger/hiero-sdk-go/tck/param"
Expand Down Expand Up @@ -37,7 +38,11 @@ func (a *AccountService) CreateAccount(_ context.Context, params param.CreateAcc
transaction.SetKey(key)
}
if params.InitialBalance != nil {
transaction.SetInitialBalance(hiero.HbarFromTinybar(*params.InitialBalance))
initialBalance, err := strconv.ParseInt(*params.InitialBalance, 10, 64)
if err != nil {
return nil, err
}
transaction.SetInitialBalance(hiero.HbarFromTinybar(initialBalance))
}
if params.ReceiverSignatureRequired != nil {
transaction.SetReceiverSignatureRequired(*params.ReceiverSignatureRequired)
Expand Down Expand Up @@ -66,7 +71,12 @@ func (a *AccountService) CreateAccount(_ context.Context, params param.CreateAcc
transaction.SetAccountMemo(*params.Memo)
}
if params.AutoRenewPeriod != nil {
transaction.SetAutoRenewPeriod(time.Duration(*params.AutoRenewPeriod) * time.Second)
autoRenewPeriodSeconds, err := strconv.ParseInt(*params.AutoRenewPeriod, 10, 64)
if err != nil {
return nil, err
}

transaction.SetAutoRenewPeriod(time.Duration(autoRenewPeriodSeconds) * time.Second)
}
if params.Alias != nil {
transaction.SetAlias(*params.Alias)
Expand Down Expand Up @@ -106,7 +116,11 @@ func (a *AccountService) UpdateAccount(_ context.Context, params param.UpdateAcc
}

if params.ExpirationTime != nil {
transaction.SetExpirationTime(time.Unix(*params.ExpirationTime, 0))
expirationTime, err := strconv.ParseInt(*params.ExpirationTime, 10, 64)
if err != nil {
return nil, err
}
transaction.SetExpirationTime(time.Unix(expirationTime, 0))
}

if params.ReceiverSignatureRequired != nil {
Expand Down Expand Up @@ -142,7 +156,11 @@ func (a *AccountService) UpdateAccount(_ context.Context, params param.UpdateAcc
}

if params.AutoRenewPeriod != nil {
transaction.SetAutoRenewPeriod(time.Duration(*params.AutoRenewPeriod) * time.Second)
autoRenewPeriodSeconds, err := strconv.ParseInt(*params.AutoRenewPeriod, 10, 64)
if err != nil {
return nil, err
}
transaction.SetAutoRenewPeriod(time.Duration(autoRenewPeriodSeconds) * time.Second)
}

if params.CommonTransactionParams != nil {
Expand Down
8 changes: 4 additions & 4 deletions tck/param/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (

type CreateAccountParams struct {
Key *string `json:"key"`
InitialBalance *int64 `json:"initialBalance"`
InitialBalance *string `json:"initialBalance"`
ReceiverSignatureRequired *bool `json:"receiverSignatureRequired"`
AutoRenewPeriod *int64 `json:"autoRenewPeriod"`
AutoRenewPeriod *string `json:"autoRenewPeriod"`
Memo *string `json:"memo"`
MaxAutomaticTokenAssociations *int32 `json:"maxAutoTokenAssociations"`
StakedAccountId *string `json:"stakedAccountId"`
Expand All @@ -24,8 +24,8 @@ type UpdateAccountParams struct {
AccountId *string `json:"accountId"`
Key *string `json:"key"`
ReceiverSignatureRequired *bool `json:"receiverSignatureRequired"`
AutoRenewPeriod *int64 `json:"autoRenewPeriod"`
ExpirationTime *int64 `json:"expirationTime"`
AutoRenewPeriod *string `json:"autoRenewPeriod"`
ExpirationTime *string `json:"expirationTime"`
Memo *string `json:"memo"`
MaxAutomaticTokenAssociations *int32 `json:"maxAutoTokenAssociations"`
StakedAccountId *string `json:"stakedAccountId"`
Expand Down

0 comments on commit 37f8c41

Please sign in to comment.