Skip to content

Commit

Permalink
fix: fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
YarikRevich committed Sep 24, 2024
1 parent 064809b commit 49e2b59
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 6 additions & 0 deletions core/transaction/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ type TxnReceipt struct {
Transaction *Transaction
}

// SmartContractTxnData data structure to hold the smart contract transaction data
type SmartContractTxnData struct {
Name string `json:"name"`
InputArgs interface{} `json:"input"`
}

type StorageAllocation struct {
ID string `json:"id"`
DataShards int `json:"data_shards"`
Expand Down
6 changes: 0 additions & 6 deletions core/transaction/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@

package transaction

// SmartContractTxnData data structure to hold the smart contract transaction data
type SmartContractTxnData struct {
Name string `json:"name"`
InputArgs interface{} `json:"input"`
}

// Transaction entity that encapsulates the transaction related data and meta data
type Transaction struct {
Hash string `json:"hash,omitempty"`
Expand Down
6 changes: 0 additions & 6 deletions core/transaction/transaction_mobile.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ import (
"strconv"
)

// SmartContractTxnData data structure to hold the smart contract transaction data
type SmartContractTxnData struct {
Name string `json:"name"`
InputArgs string `json:"input"`
}

// Transaction represents entity that encapsulates the transaction related data and metadata.
type Transaction struct {
Hash string `json:"hash,omitempty"`
Expand Down
8 changes: 7 additions & 1 deletion zboxcore/sdk/transaction_mobile.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ func ExecuteSmartContract(address string, sn transaction.SmartContractTxnData, v
}

wg.Add(1)
err = txn.ExecuteSmartContract(address, sn.Name, sn.InputArgs, value)

inputRaw, ok := sn.InputArgs.(string)
if !ok {
return nil, fmt.Errorf("failed to convert input args")
}

err = txn.ExecuteSmartContract(address, sn.Name, inputRaw, value)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 49e2b59

Please sign in to comment.