Closed bguiz closed 1 month ago
In the Go SDK, and extra step is required. See the steps to reproduce below.
In the JS SDK you can do this:
const topicMsgSubmitTx = await new TopicMessageSubmitTransaction() .setTopicId(topicId) .setMessage('Hello HCS!') .freezeWith(client);
However, in the Go SDK, if you do this, you will get an error:
topicMsgSubmitTx, _ := hedera.NewTopicMessageSubmitTransaction(). SetTopicID(*topicId). SetMessage("Hello HCS!"). FreezeWith(client);
Turns out that the Go SDK does not accept a string as the parameter, and a typecast to be done manually:
topicMsgSubmitTx, _ := hedera.NewTopicMessageSubmitTransaction(). SetTopicID(*topicId). SetMessage([]byte("Hello HCS!")). FreezeWith(client);
nil
testnet
github.com/hashgraph/hedera-sdk-go/v2 v2.37.0 // indirect
macOS
Hey @bguiz , thanks for opening this issue. It seems like in Go we are missing the method that accepts string as a parameter. Will be added in the next release.
Description
In the Go SDK, and extra step is required. See the steps to reproduce below.
Steps to reproduce
In the JS SDK you can do this:
However, in the Go SDK, if you do this, you will get an error:
Turns out that the Go SDK does not accept a string as the parameter, and a typecast to be done manually:
Additional context
nil
Hedera network
testnet
Version
github.com/hashgraph/hedera-sdk-go/v2 v2.37.0 // indirect
Operating system
macOS