Skip to content

Commit

Permalink
Merge pull request #10 from ElrondNetwork/fix-windows
Browse files Browse the repository at this point in the history
data-field-as-byte-array
  • Loading branch information
andreibancioiu authored Jul 27, 2020
2 parents bf519a3 + 7b1b0f8 commit ae3c9b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion deps/uint256/uint256.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ bool tostring128(uint128_t *number, uint32_t base, char *out,
bool tostring256(uint256_t *number, uint32_t base, char *out,
uint32_t outLength);

#endif /* _UINT256_H_ */
#endif /* _UINT256_H_ */
11 changes: 3 additions & 8 deletions testApp/cmd/testApp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ type transaction struct {
SndAddr string `json:"sender"`
GasPrice uint64 `json:"gasPrice,omitempty"`
GasLimit uint64 `json:"gasLimit,omitempty"`
Data string `json:"data,omitempty"`
Data []byte `json:"data,omitempty"`
Signature string `json:"signature,omitempty"`
ChainID string `json:"chainID"`
Version uint32 `json:"version"`
Expand Down Expand Up @@ -192,12 +192,7 @@ func getDeviceInfo(nanos *ledger.NanoS) error {

// trim removes the trailing crlf characters from the end of a string
func trim(s string) string {
if strings.HasSuffix(s, "\n") {
s = strings.TrimSuffix(s, "\n")
}
if strings.HasSuffix(s, "\r") {
s = strings.TrimSuffix(s, "\r")
}
s = strings.TrimRight(s, "\n\r")
return s
}

Expand Down Expand Up @@ -357,7 +352,7 @@ func main() {
tx.Value = bigIntAmount.String()
tx.Nonce = nonce
tx.GasPrice = netConfig.Data.Config.MinGasPrice
tx.Data = data
tx.Data = []byte(data)
tx.GasLimit = netConfig.Data.Config.MinGasLimit + uint64(len(data))*netConfig.Data.Config.GasPerDataByte
tx.ChainID = netConfig.Data.Config.ChainID
tx.Version = netConfig.Data.Config.MinTransactionVersion
Expand Down

0 comments on commit ae3c9b8

Please sign in to comment.