Skip to content

Commit

Permalink
chore: fix build
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Ivanov <ivanivanov.ii726@gmail.com>
  • Loading branch information
0xivanov committed Nov 20, 2024
1 parent 9d2be26 commit 78da44a
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 15 deletions.
1 change: 1 addition & 0 deletions ecdsa_public_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ func (pk _ECDSAPublicKey) _VerifyTransaction(tx *Transaction[TransactionInterfac
}

func (pk _ECDSAPublicKey) _ToFullKey() []byte {
// nolint
return elliptic.Marshal(btcec.S256(), pk.X(), pk.Y())
}

Expand Down
2 changes: 1 addition & 1 deletion tck/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ require (
golang.org/x/text v0.19.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.35.1 // indirect
google.golang.org/protobuf v1.35.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
12 changes: 9 additions & 3 deletions tck/go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ=
github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
Expand All @@ -13,17 +14,21 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
Expand All @@ -44,6 +49,7 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8=
github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
Expand Down Expand Up @@ -79,10 +85,10 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:
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.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=
google.golang.org/protobuf v1.35.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=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
6 changes: 3 additions & 3 deletions tck/methods/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (a *AccountService) CreateAccount(_ context.Context, accountCreateParams pa
transaction.SetAlias(*accountCreateParams.Alias)
}
if accountCreateParams.CommonTransactionParams != nil {
accountCreateParams.CommonTransactionParams.FillOutTransaction(transaction, &transaction.Transaction, a.sdkService.Client)
accountCreateParams.CommonTransactionParams.FillOutTransaction(transaction, a.sdkService.Client)
}
txResponse, err := transaction.Execute(a.sdkService.Client)
if err != nil {
Expand Down Expand Up @@ -144,7 +144,7 @@ func (a *AccountService) UpdateAccount(_ context.Context, accountUpdateParams pa
}

if accountUpdateParams.CommonTransactionParams != nil {
accountUpdateParams.CommonTransactionParams.FillOutTransaction(transaction, &transaction.Transaction, a.sdkService.Client)
accountUpdateParams.CommonTransactionParams.FillOutTransaction(transaction, a.sdkService.Client)
}

txResponse, err := transaction.Execute(a.sdkService.Client)
Expand Down Expand Up @@ -172,7 +172,7 @@ func (a *AccountService) DeleteAccount(_ context.Context, deleteAccountParams pa
}

if deleteAccountParams.CommonTransactionParams != nil {
deleteAccountParams.CommonTransactionParams.FillOutTransaction(transaction, &transaction.Transaction, a.sdkService.Client)
deleteAccountParams.CommonTransactionParams.FillOutTransaction(transaction, a.sdkService.Client)
}

txResponse, err := transaction.Execute(a.sdkService.Client)
Expand Down
16 changes: 8 additions & 8 deletions tck/param/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,33 @@ type CommonTransactionParams struct {
Signers *[]string `json:"signers"`
}

func (common *CommonTransactionParams) FillOutTransaction(transactionInterface hedera.TransactionInterface, transaction *hedera.Transaction, client *hedera.Client) {
func (common *CommonTransactionParams) FillOutTransaction(transactionInterface hedera.TransactionInterface, client *hedera.Client) {
if common.TransactionId != nil {
txId, _ := hedera.TransactionIdFromString(*common.TransactionId)
transaction.SetTransactionID(txId)
hedera.TransactionSetTransactionID(transactionInterface, txId)
}

if common.MaxTransactionFee != nil {
transaction.SetMaxTransactionFee(hedera.HbarFromTinybar(*common.MaxTransactionFee))
hedera.TransactionSetMaxTransactionFee(transactionInterface, hedera.HbarFromTinybar(*common.MaxTransactionFee))
}

if common.ValidTransactionDuration != nil {
transaction.SetTransactionValidDuration(time.Duration(*common.ValidTransactionDuration) * time.Second)
hedera.TransactionSetTransactionValidDuration(transactionInterface, time.Duration(*common.ValidTransactionDuration)*time.Second)
}

if common.Memo != nil {
transaction.SetTransactionMemo(*common.Memo)
hedera.TransactionSetTransactionMemo(transactionInterface, *common.Memo)
}

if common.RegenerateTransactionId != nil {
transaction.SetRegenerateTransactionID(*common.RegenerateTransactionId)
hedera.TransactionSetTransactionID(transactionInterface, hedera.TransactionIDGenerate(client.GetOperatorAccountID()))
}

if common.Signers != nil {
transaction.FreezeWith(client, transactionInterface)
hedera.TransactionFreezeWith(transactionInterface, client)
for _, signer := range *common.Signers {
s, _ := hedera.PrivateKeyFromString(signer)
transaction.Sign(s)
hedera.TransactionSign(transactionInterface, s)
}
}
}
10 changes: 10 additions & 0 deletions transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -1497,6 +1497,16 @@ func TransactionGetSignatures(tx TransactionInterface) (map[AccountID]map[*Publi
return tx.getBaseTransaction().GetSignatures()
}

func TransactionFreezeWith(tx TransactionInterface, client *Client) (TransactionInterface, error) {
baseTx := tx.getBaseTransaction()
_, err := baseTx.FreezeWith(client)
if err != nil {
return tx, err
}

return tx, nil
}

func TransactionSignWithOperator(tx TransactionInterface, client *Client) (TransactionInterface, error) {
baseTx := tx.getBaseTransaction()
_, err := baseTx.SignWithOperator(client)
Expand Down

0 comments on commit 78da44a

Please sign in to comment.