github.com/hashgraph/hedera-sdk-go/v2@v2.48.0/contract_function_parameters_e2e_test.go (about)

     1  //go:build all || e2e
     2  // +build all e2e
     3  
     4  package hedera
     5  
     6  /*-
     7   *
     8   * Hedera Go SDK
     9   *
    10   * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC
    11   *
    12   * Licensed under the Apache License, Version 2.0 (the "License");
    13   * you may not use this file except in compliance with the License.
    14   * You may obtain a copy of the License at
    15   *
    16   *      http://www.apache.org/licenses/LICENSE-2.0
    17   *
    18   * Unless required by applicable law or agreed to in writing, software
    19   * distributed under the License is distributed on an "AS IS" BASIS,
    20   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    21   * See the License for the specific language governing permissions and
    22   * limitations under the License.
    23   *
    24   */
    25  
    26  import (
    27  	"encoding/hex"
    28  	"math/big"
    29  	"reflect"
    30  	"strings"
    31  	"sync"
    32  	"testing"
    33  
    34  	"github.com/ethereum/go-ethereum/common"
    35  	"github.com/ethereum/go-ethereum/common/math"
    36  	"github.com/stretchr/testify/require"
    37  )
    38  
    39  var (
    40  	contractID   ContractID
    41  	deployedOnce sync.Once
    42  	intTypeMap   = map[string]intTypeData{"int256": {(*ContractFunctionParameters).AddInt256,
    43  		func(result *ContractFunctionResult) []byte { return result.GetInt256(0) },
    44  		"returnInt256",
    45  	},
    46  		"int248": {(*ContractFunctionParameters).AddInt248,
    47  			func(result *ContractFunctionResult) []byte { return result.GetInt248(0) },
    48  			"returnInt248",
    49  		},
    50  		"int240": {(*ContractFunctionParameters).AddInt240,
    51  			func(result *ContractFunctionResult) []byte { return result.GetInt240(0) },
    52  			"returnInt240",
    53  		},
    54  		"int232": {(*ContractFunctionParameters).AddInt232,
    55  			func(result *ContractFunctionResult) []byte { return result.GetInt232(0) },
    56  			"returnInt232",
    57  		},
    58  		"int224": {(*ContractFunctionParameters).AddInt224,
    59  			func(result *ContractFunctionResult) []byte { return result.GetInt224(0) },
    60  			"returnInt224",
    61  		},
    62  		"int216": {(*ContractFunctionParameters).AddInt216,
    63  			func(result *ContractFunctionResult) []byte { return result.GetInt216(0) },
    64  			"returnInt216",
    65  		},
    66  		"int208": {(*ContractFunctionParameters).AddInt208,
    67  			func(result *ContractFunctionResult) []byte { return result.GetInt208(0) },
    68  			"returnInt208",
    69  		},
    70  		"int200": {(*ContractFunctionParameters).AddInt200,
    71  			func(result *ContractFunctionResult) []byte { return result.GetInt200(0) },
    72  			"returnInt200",
    73  		},
    74  		"int192": {(*ContractFunctionParameters).AddInt192,
    75  			func(result *ContractFunctionResult) []byte { return result.GetInt192(0) },
    76  			"returnInt192",
    77  		},
    78  		"int184": {(*ContractFunctionParameters).AddInt184,
    79  			func(result *ContractFunctionResult) []byte { return result.GetInt184(0) },
    80  			"returnInt184",
    81  		},
    82  		"int176": {(*ContractFunctionParameters).AddInt176,
    83  			func(result *ContractFunctionResult) []byte { return result.GetInt176(0) },
    84  			"returnInt176",
    85  		},
    86  		"int168": {(*ContractFunctionParameters).AddInt168,
    87  			func(result *ContractFunctionResult) []byte { return result.GetInt168(0) },
    88  			"returnInt168",
    89  		},
    90  		"int160": {(*ContractFunctionParameters).AddInt160,
    91  			func(result *ContractFunctionResult) []byte { return result.GetInt160(0) },
    92  			"returnInt160",
    93  		},
    94  		"int152": {(*ContractFunctionParameters).AddInt152,
    95  			func(result *ContractFunctionResult) []byte { return result.GetInt152(0) },
    96  			"returnInt152",
    97  		},
    98  		"int144": {(*ContractFunctionParameters).AddInt144,
    99  			func(result *ContractFunctionResult) []byte { return result.GetInt144(0) },
   100  			"returnInt144",
   101  		},
   102  		"int136": {(*ContractFunctionParameters).AddInt136,
   103  			func(result *ContractFunctionResult) []byte { return result.GetInt136(0) },
   104  			"returnInt136",
   105  		},
   106  		"int128": {(*ContractFunctionParameters).AddInt128,
   107  			func(result *ContractFunctionResult) []byte { return result.GetInt128(0) },
   108  			"returnInt128",
   109  		},
   110  		"int120": {(*ContractFunctionParameters).AddInt120,
   111  			func(result *ContractFunctionResult) []byte { return result.GetInt120(0) },
   112  			"returnInt120",
   113  		},
   114  		"int112": {(*ContractFunctionParameters).AddInt112,
   115  			func(result *ContractFunctionResult) []byte { return result.GetInt112(0) },
   116  			"returnInt112",
   117  		},
   118  		"int104": {(*ContractFunctionParameters).AddInt104,
   119  			func(result *ContractFunctionResult) []byte { return result.GetInt104(0) },
   120  			"returnInt104",
   121  		},
   122  		"int96": {(*ContractFunctionParameters).AddInt96,
   123  			func(result *ContractFunctionResult) []byte { return result.GetInt96(0) },
   124  			"returnInt96",
   125  		},
   126  		"int88": {(*ContractFunctionParameters).AddInt88,
   127  			func(result *ContractFunctionResult) []byte { return result.GetInt88(0) },
   128  			"returnInt88",
   129  		},
   130  		"int80": {(*ContractFunctionParameters).AddInt80,
   131  			func(result *ContractFunctionResult) []byte { return result.GetInt80(0) },
   132  			"returnInt80",
   133  		},
   134  		"int72": {(*ContractFunctionParameters).AddInt72,
   135  			func(result *ContractFunctionResult) []byte { return result.GetInt72(0) },
   136  			"returnInt72",
   137  		},
   138  		"uint256": {(*ContractFunctionParameters).AddUint256,
   139  			func(result *ContractFunctionResult) []byte { return result.GetUint256(0) },
   140  			"returnUint256",
   141  		},
   142  		"uint248": {(*ContractFunctionParameters).AddUint248,
   143  			func(result *ContractFunctionResult) []byte { return result.GetUint248(0) },
   144  			"returnUint248",
   145  		},
   146  		"uint240": {(*ContractFunctionParameters).AddUint240,
   147  			func(result *ContractFunctionResult) []byte { return result.GetUint240(0) },
   148  			"returnUint240",
   149  		},
   150  		"uint232": {(*ContractFunctionParameters).AddUint232,
   151  			func(result *ContractFunctionResult) []byte { return result.GetUint232(0) },
   152  			"returnUint232",
   153  		},
   154  		"uint224": {(*ContractFunctionParameters).AddUint224,
   155  			func(result *ContractFunctionResult) []byte { return result.GetUint224(0) },
   156  			"returnUint224",
   157  		},
   158  		"uint216": {(*ContractFunctionParameters).AddUint216,
   159  			func(result *ContractFunctionResult) []byte { return result.GetUint216(0) },
   160  			"returnUint216",
   161  		},
   162  		"uint208": {(*ContractFunctionParameters).AddUint208,
   163  			func(result *ContractFunctionResult) []byte { return result.GetUint208(0) },
   164  			"returnUint208",
   165  		},
   166  		"uint200": {(*ContractFunctionParameters).AddUint200,
   167  			func(result *ContractFunctionResult) []byte { return result.GetUint200(0) },
   168  			"returnUint200",
   169  		},
   170  		"uint192": {(*ContractFunctionParameters).AddUint192,
   171  			func(result *ContractFunctionResult) []byte { return result.GetInt192(0) },
   172  			"returnUint192",
   173  		},
   174  		"uint184": {(*ContractFunctionParameters).AddUint184,
   175  			func(result *ContractFunctionResult) []byte { return result.GetUint184(0) },
   176  			"returnUint184",
   177  		},
   178  		"uint176": {(*ContractFunctionParameters).AddUint176,
   179  			func(result *ContractFunctionResult) []byte { return result.GetUint176(0) },
   180  			"returnUint176",
   181  		},
   182  		"uint168": {(*ContractFunctionParameters).AddUint168,
   183  			func(result *ContractFunctionResult) []byte { return result.GetUint168(0) },
   184  			"returnUint168",
   185  		},
   186  		"uint160": {(*ContractFunctionParameters).AddUint160,
   187  			func(result *ContractFunctionResult) []byte { return result.GetUint160(0) },
   188  			"returnUint160",
   189  		},
   190  		"uint152": {(*ContractFunctionParameters).AddUint152,
   191  			func(result *ContractFunctionResult) []byte { return result.GetUint152(0) },
   192  			"returnUint152",
   193  		},
   194  		"uint144": {(*ContractFunctionParameters).AddUint144,
   195  			func(result *ContractFunctionResult) []byte { return result.GetUint144(0) },
   196  			"returnUint144",
   197  		},
   198  		"uint136": {(*ContractFunctionParameters).AddUint136,
   199  			func(result *ContractFunctionResult) []byte { return result.GetUint136(0) },
   200  			"returnUint136",
   201  		},
   202  		"uint128": {(*ContractFunctionParameters).AddUint128,
   203  			func(result *ContractFunctionResult) []byte { return result.GetUint128(0) },
   204  			"returnUint128",
   205  		},
   206  		"uint120": {(*ContractFunctionParameters).AddUint120,
   207  			func(result *ContractFunctionResult) []byte { return result.GetUint120(0) },
   208  			"returnUint120",
   209  		},
   210  		"uint112": {(*ContractFunctionParameters).AddUint112,
   211  			func(result *ContractFunctionResult) []byte { return result.GetUint112(0) },
   212  			"returnUint112",
   213  		},
   214  		"uint104": {(*ContractFunctionParameters).AddUint104,
   215  			func(result *ContractFunctionResult) []byte { return result.GetUint104(0) },
   216  			"returnUint104",
   217  		},
   218  		"uint96": {(*ContractFunctionParameters).AddUint96,
   219  			func(result *ContractFunctionResult) []byte { return result.GetUint96(0) },
   220  			"returnUint96",
   221  		},
   222  		"uint88": {(*ContractFunctionParameters).AddUint88,
   223  			func(result *ContractFunctionResult) []byte { return result.GetUint88(0) },
   224  			"returnUint88",
   225  		},
   226  		"uint80": {(*ContractFunctionParameters).AddUint80,
   227  			func(result *ContractFunctionResult) []byte { return result.GetUint80(0) },
   228  			"returnUint80",
   229  		},
   230  		"uint72": {(*ContractFunctionParameters).AddUint72,
   231  			func(result *ContractFunctionResult) []byte { return result.GetUint72(0) },
   232  			"returnUint72",
   233  		},
   234  	}
   235  )
   236  
   237  type intTypeData struct {
   238  	fnAdd     func(parameters *ContractFunctionParameters, value []byte) *ContractFunctionParameters
   239  	fnExtract func(result *ContractFunctionResult) []byte
   240  	fnName    string
   241  }
   242  
   243  func intType(t *testing.T, env IntegrationTestEnv, intType string, value string) {
   244  	data, ok := intTypeMap[intType]
   245  	require.True(t, ok)
   246  
   247  	valueBigInt, ok := new(big.Int).SetString(value, 10)
   248  	require.True(t, ok)
   249  	valueBigIntCopy := new(big.Int).Set(valueBigInt)
   250  
   251  	contractCall, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   252  		SetContractID(contractID).
   253  		SetQueryPayment(NewHbar(20)).
   254  		SetFunction(data.fnName, data.fnAdd(NewContractFunctionParameters(), math.U256Bytes(valueBigInt))).
   255  		Execute(env.Client)
   256  
   257  	require.NoError(t, err)
   258  	resultBigInt := new(big.Int)
   259  	if strings.Contains(intType, "uint") {
   260  		resultBigInt = new(big.Int).SetBytes(data.fnExtract(&contractCall))
   261  	} else {
   262  		value := new(big.Int).SetBytes(data.fnExtract(&contractCall))
   263  		resultBigInt = math.S256(value)
   264  	}
   265  
   266  	require.Equal(t, valueBigIntCopy.String(), resultBigInt.String())
   267  }
   268  
   269  func deployContract(env IntegrationTestEnv) (*ContractID, error) {
   270  	var result *ContractID
   271  	var err error
   272  
   273  	deployedOnce.Do(func() {
   274  		result, err = performDeploy(env)
   275  		if err == nil {
   276  			contractID = *result
   277  		}
   278  	})
   279  	return result, err
   280  }
   281  
   282  func performDeploy(env IntegrationTestEnv) (*ContractID, error) {
   283  	bytecode := []byte(`0x608060405234801561001057600080fd5b50611f83806100206000396000f3fe608060405234801561001057600080fd5b50600436106104805760003560e01c806381dbe13e11610257578063bb6b524311610146578063dbb04ed9116100c3578063e713cda811610087578063e713cda814610df6578063f4e490f514610e19578063f6e877f414610e3a578063f8293f6e14610e60578063ffb8050114610e8257600080fd5b8063dbb04ed914610d2d578063de9fb48414610d56578063e05e91e014610d83578063e066de5014610daa578063e0f53e2414610dd057600080fd5b8063cbd2e6a51161010a578063cbd2e6a514610c9a578063cdb9e4e814610cbf578063d1b10ad71461066d578063d79d4d4014610ce5578063dade0c0b14610d0b57600080fd5b8063bb6b524314610bdc578063bd90536a14610c02578063c503772d14610c2a578063c6c18a1c14610c4a578063c7d8b87e14610c7457600080fd5b8063a1bda122116101d4578063b4e3e7b111610198578063b4e3e7b114610b28578063b834bfe914610b4e578063b8da8d1614610b6f578063b989c7ee14610b95578063ba945bdb14610bb657600080fd5b8063a1bda12214610a9f578063a401d60d14610ac0578063a75761f114610ae6578063aa80ca2e14610733578063b2db404a14610b0757600080fd5b8063923f5edf1161021b578063923f5edf146109f557806394cd7c8014610a1657806398508ba314610a375780639b1794ae14610a58578063a08b9f6714610a7e57600080fd5b806381dbe13e14610978578063827147ce146105cf578063881c8fb71461099357806388b7e6f5146109b9578063909c5b24146109da57600080fd5b806338fa665811610373578063628bc3ef116102f057806372a06b4d116102b457806372a06b4d146108ef578063796a27ea146109105780637d0dc262146109365780637ec32d84146109575780637f8082f71461073357600080fd5b8063628bc3ef1461083f57806364e008c11461086057806368ef4466146108815780636a54715c146108a257806370a5cb81146108c357600080fd5b806344e7b0371161033757806344e7b0371461068957806348d848d0146107d95780634bbc9a67146107f7578063545e21131461081257806359adb2df1461066d57600080fd5b806338fa6658146107335780633b45e6e01461074e5780633e1a27711461076f5780633f396e6714610790578063407b899b146107b857600080fd5b8063129ed5da116104015780632421101f116103c55780632421101f146106895780632ef16e8e146106af5780632f47a40d146106d05780632f6c1bb4146106f157806333520ec31461071257600080fd5b8063129ed5da146105ea57806312cd95a114610610578063189cea8e146106315780631d1145621461065257806322937ea91461066d57600080fd5b80630a958dc8116104485780630a958dc81461054b57806310d545531461056c578063118b84151461058d57806311ec6c90146105ae578063126bc815146105cf57600080fd5b8063017fa10b14610485578063021d88ab146104b357806303745430146104de57806306ac6fe1146104ff57806308123e0914610525575b600080fd5b6104966104933660046117ac565b90565b6040516001600160801b0390911681526020015b60405180910390f35b6104c1610493366004611b97565b6040516bffffffffffffffffffffffff90911681526020016104aa565b6104ec610493366004611333565b604051600c9190910b81526020016104aa565b61050d610493366004611785565b6040516001600160781b0390911681526020016104aa565b610533610493366004611aa9565b60405166ffffffffffffff90911681526020016104aa565b610559610493366004611609565b60405160049190910b81526020016104aa565b61057a6104933660046113d8565b60405160119190910b81526020016104aa565b61059b6104933660046115c7565b604051601e9190910b81526020016104aa565b6105bc61049336600461143b565b60405160139190910b81526020016104aa565b6105dd6104933660046112f8565b6040516104aa9190611d82565b6105f8610493366004611821565b6040516001600160981b0390911681526020016104aa565b61061e6104933660046113f9565b60405160129190910b81526020016104aa565b61063f61049336600461149e565b60405160169190910b81526020016104aa565b610660610493366004610fbd565b6040516104aa9190611c0e565b61067b6104933660046112e0565b6040519081526020016104aa565b610697610493366004610f9a565b6040516001600160a01b0390911681526020016104aa565b6106bd6104933660046115a6565b604051601d9190910b81526020016104aa565b6106de6104933660046116ef565b604051600a9190910b81526020016104aa565b6106ff610493366004611501565b60405160199190910b81526020016104aa565b610720610493366004611522565b604051601a9190910b81526020016104aa565b6107416104933660046110ec565b6040516104aa9190611c95565b61075c6104933660046113b7565b60405160109190910b81526020016104aa565b61077d610493366004611564565b604051601c9190910b81526020016104aa565b61079e610493366004611af8565b60405168ffffffffffffffffff90911681526020016104aa565b6107c661049336600461166c565b60405160079190910b81526020016104aa565b6107e76104933660046112c6565b60405190151581526020016104aa565b61080561049336600461105e565b6040516104aa9190611c5b565b6108256108203660046116ae565b610ea6565b60408051600093840b81529190920b6020820152016104aa565b61084d6104933660046116ce565b60405160099190910b81526020016104aa565b61086e6104933660046114bf565b60405160179190910b81526020016104aa565b61088f61049336600461145c565b60405160149190910b81526020016104aa565b6108b061049336600461164b565b60405160069190910b81526020016104aa565b6108d1610493366004611731565b6040516cffffffffffffffffffffffffff90911681526020016104aa565b6108fd6104933660046116ae565b60405160009190910b81526020016104aa565b61091e610493366004611954565b6040516001600160d81b0390911681526020016104aa565b610944610493366004611543565b604051601b9190910b81526020016104aa565b610965610493366004611585565b60405160029190910b81526020016104aa565b610986610493366004611224565b6040516104aa9190611d2e565b6109a1610493366004611891565b6040516001600160b01b0390911681526020016104aa565b6109c7610493366004611396565b604051600f9190910b81526020016104aa565b6109e8610493366004611173565b6040516104aa9190611ccd565b610a0361049336600461147d565b60405160159190910b81526020016104aa565b610a246104933660046114e0565b60405160189190910b81526020016104aa565b610a45610493366004611354565b604051600d9190910b81526020016104aa565b610a666104933660046118b8565b6040516001600160b81b0390911681526020016104aa565b610a8c610493366004611710565b604051600b9190910b81526020016104aa565b610aad61049336600461141a565b60405160019190910b81526020016104aa565b610ace6104933660046119ec565b6040516001600160f01b0390911681526020016104aa565b610af4610493366004611848565b60405161ffff90911681526020016104aa565b610b1561049336600461162a565b60405160059190910b81526020016104aa565b610b3661049336600461175e565b6040516001600160701b0390911681526020016104aa565b610b5c610493366004611375565b604051600e9190910b81526020016104aa565b610b7d61049336600461186a565b6040516001600160a81b0390911681526020016104aa565b610ba36104933660046115e8565b60405160039190910b81526020016104aa565b610bc46104933660046117d3565b6040516001600160881b0390911681526020016104aa565b610bea610493366004611906565b6040516001600160c81b0390911681526020016104aa565b610c15610c103660046112e0565b610ebe565b604080519283526020830191909152016104aa565b610c38610493366004611b21565b60405160ff90911681526020016104aa565b610c58610493366004611b6c565b6040516affffffffffffffffffffff90911681526020016104aa565b610c82610493366004611a13565b6040516001600160f81b0390911681526020016104aa565b610ca8610493366004611a83565b60405165ffffffffffff90911681526020016104aa565b610ccd61049336600461197b565b6040516001600160e01b0390911681526020016104aa565b610cf361049336600461192d565b6040516001600160d01b0390911681526020016104aa565b610d1e610d19366004611a3a565b610ecd565b6040516104aa93929190611d95565b610d3b610493366004611b42565b60405169ffffffffffffffffffff90911681526020016104aa565b610d69610d64366004611609565b610f0b565b60408051600493840b81529190920b6020820152016104aa565b610d91610493366004611ad0565b60405167ffffffffffffffff90911681526020016104aa565b610db86104933660046119a2565b6040516001600160e81b0390911681526020016104aa565b610dde6104933660046118df565b6040516001600160c01b0390911681526020016104aa565b610e04610493366004611a3a565b60405163ffffffff90911681526020016104aa565b610e2761049336600461168d565b60405160089190910b81526020016104aa565b610e486104933660046117fa565b6040516001600160901b0390911681526020016104aa565b610e6e6104933660046119c9565b60405162ffffff90911681526020016104aa565b610e90610493366004611a5e565b60405164ffffffffff90911681526020016104aa565b60008082610eb5816014611ead565b91509150915091565b60008082610eb5816001611e22565b600080606083610ede600182611ee4565b6040805180820190915260028152614f4b60f01b602082015291945063ffffffff16925090509193909250565b60008082610eb5816001611e63565b80358015158114610f2a57600080fd5b919050565b600082601f830112610f3f578081fd5b813567ffffffffffffffff811115610f5957610f59611f1f565b610f6c601f8201601f1916602001611dcd565b818152846020838601011115610f80578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215610fab578081fd5b8135610fb681611f35565b9392505050565b60006020808385031215610fcf578182fd5b823567ffffffffffffffff811115610fe5578283fd5b8301601f81018513610ff5578283fd5b803561100861100382611dfe565b611dcd565b80828252848201915084840188868560051b8701011115611027578687fd5b8694505b8385101561105257803561103e81611f35565b83526001949094019391850191850161102b565b50979650505050505050565b60006020808385031215611070578182fd5b823567ffffffffffffffff811115611086578283fd5b8301601f81018513611096578283fd5b80356110a461100382611dfe565b80828252848201915084840188868560051b87010111156110c3578687fd5b8694505b83851015611052576110d881610f1a565b8352600194909401939185019185016110c7565b600060208083850312156110fe578182fd5b823567ffffffffffffffff811115611114578283fd5b8301601f81018513611124578283fd5b803561113261100382611dfe565b80828252848201915084840188868560051b8701011115611151578687fd5b8694505b83851015611052578035835260019490940193918501918501611155565b60006020808385031215611185578182fd5b823567ffffffffffffffff8082111561119c578384fd5b818501915085601f8301126111af578384fd5b81356111bd61100382611dfe565b80828252858201915085850189878560051b88010111156111dc578788fd5b875b84811015611215578135868111156111f457898afd5b6112028c8a838b0101610f2f565b85525092870192908701906001016111de565b50909998505050505050505050565b60006020808385031215611236578182fd5b823567ffffffffffffffff8082111561124d578384fd5b818501915085601f830112611260578384fd5b813561126e61100382611dfe565b80828252858201915085850189878560051b880101111561128d578788fd5b875b84811015611215578135868111156112a557898afd5b6112b38c8a838b0101610f2f565b855250928701929087019060010161128f565b6000602082840312156112d7578081fd5b610fb682610f1a565b6000602082840312156112f1578081fd5b5035919050565b600060208284031215611309578081fd5b813567ffffffffffffffff81111561131f578182fd5b61132b84828501610f2f565b949350505050565b600060208284031215611344578081fd5b813580600c0b8114610fb6578182fd5b600060208284031215611365578081fd5b813580600d0b8114610fb6578182fd5b600060208284031215611386578081fd5b813580600e0b8114610fb6578182fd5b6000602082840312156113a7578081fd5b813580600f0b8114610fb6578182fd5b6000602082840312156113c8578081fd5b81358060100b8114610fb6578182fd5b6000602082840312156113e9578081fd5b81358060110b8114610fb6578182fd5b60006020828403121561140a578081fd5b81358060120b8114610fb6578182fd5b60006020828403121561142b578081fd5b81358060010b8114610fb6578182fd5b60006020828403121561144c578081fd5b81358060130b8114610fb6578182fd5b60006020828403121561146d578081fd5b81358060140b8114610fb6578182fd5b60006020828403121561148e578081fd5b81358060150b8114610fb6578182fd5b6000602082840312156114af578081fd5b81358060160b8114610fb6578182fd5b6000602082840312156114d0578081fd5b81358060170b8114610fb6578182fd5b6000602082840312156114f1578081fd5b81358060180b8114610fb6578182fd5b600060208284031215611512578081fd5b81358060190b8114610fb6578182fd5b600060208284031215611533578081fd5b813580601a0b8114610fb6578182fd5b600060208284031215611554578081fd5b813580601b0b8114610fb6578182fd5b600060208284031215611575578081fd5b813580601c0b8114610fb6578182fd5b600060208284031215611596578081fd5b81358060020b8114610fb6578182fd5b6000602082840312156115b7578081fd5b813580601d0b8114610fb6578182fd5b6000602082840312156115d8578081fd5b813580601e0b8114610fb6578182fd5b6000602082840312156115f9578081fd5b81358060030b8114610fb6578182fd5b60006020828403121561161a578081fd5b81358060040b8114610fb6578182fd5b60006020828403121561163b578081fd5b81358060050b8114610fb6578182fd5b60006020828403121561165c578081fd5b81358060060b8114610fb6578182fd5b60006020828403121561167d578081fd5b81358060070b8114610fb6578182fd5b60006020828403121561169e578081fd5b81358060080b8114610fb6578182fd5b6000602082840312156116bf578081fd5b813580820b8114610fb6578182fd5b6000602082840312156116df578081fd5b81358060090b8114610fb6578182fd5b600060208284031215611700578081fd5b813580600a0b8114610fb6578182fd5b600060208284031215611721578081fd5b813580600b0b8114610fb6578182fd5b600060208284031215611742578081fd5b81356cffffffffffffffffffffffffff81168114610fb6578182fd5b60006020828403121561176f578081fd5b81356001600160701b0381168114610fb6578182fd5b600060208284031215611796578081fd5b81356001600160781b0381168114610fb6578182fd5b6000602082840312156117bd578081fd5b81356001600160801b0381168114610fb6578182fd5b6000602082840312156117e4578081fd5b81356001600160881b0381168114610fb6578182fd5b60006020828403121561180b578081fd5b81356001600160901b0381168114610fb6578182fd5b600060208284031215611832578081fd5b81356001600160981b0381168114610fb6578182fd5b600060208284031215611859578081fd5b813561ffff81168114610fb6578182fd5b60006020828403121561187b578081fd5b81356001600160a81b0381168114610fb6578182fd5b6000602082840312156118a2578081fd5b81356001600160b01b0381168114610fb6578182fd5b6000602082840312156118c9578081fd5b81356001600160b81b0381168114610fb6578182fd5b6000602082840312156118f0578081fd5b81356001600160c01b0381168114610fb6578182fd5b600060208284031215611917578081fd5b81356001600160c81b0381168114610fb6578182fd5b60006020828403121561193e578081fd5b81356001600160d01b0381168114610fb6578182fd5b600060208284031215611965578081fd5b81356001600160d81b0381168114610fb6578182fd5b60006020828403121561198c578081fd5b81356001600160e01b0381168114610fb6578182fd5b6000602082840312156119b3578081fd5b81356001600160e81b0381168114610fb6578182fd5b6000602082840312156119da578081fd5b813562ffffff81168114610fb6578182fd5b6000602082840312156119fd578081fd5b81356001600160f01b0381168114610fb6578182fd5b600060208284031215611a24578081fd5b81356001600160f81b0381168114610fb6578182fd5b600060208284031215611a4b578081fd5b813563ffffffff81168114610fb6578182fd5b600060208284031215611a6f578081fd5b813564ffffffffff81168114610fb6578182fd5b600060208284031215611a94578081fd5b813565ffffffffffff81168114610fb6578182fd5b600060208284031215611aba578081fd5b813566ffffffffffffff81168114610fb6578182fd5b600060208284031215611ae1578081fd5b813567ffffffffffffffff81168114610fb6578182fd5b600060208284031215611b09578081fd5b813568ffffffffffffffffff81168114610fb6578182fd5b600060208284031215611b32578081fd5b813560ff81168114610fb6578182fd5b600060208284031215611b53578081fd5b813569ffffffffffffffffffff81168114610fb6578182fd5b600060208284031215611b7d578081fd5b81356affffffffffffffffffffff81168114610fb6578182fd5b600060208284031215611ba8578081fd5b81356bffffffffffffffffffffffff81168114610fb6578182fd5b60008151808452815b81811015611be857602081850181015186830182015201611bcc565b81811115611bf95782602083870101525b50601f01601f19169290920160200192915050565b6020808252825182820181905260009190848201906040850190845b81811015611c4f5783516001600160a01b031683529284019291840191600101611c2a565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015611c4f578351151583529284019291840191600101611c77565b6020808252825182820181905260009190848201906040850190845b81811015611c4f57835183529284019291840191600101611cb1565b6000602080830181845280855180835260408601915060408160051b8701019250838701855b82811015611d2157603f19888603018452611d0f858351611bc3565b94509285019290850190600101611cf3565b5092979650505050505050565b6000602080830181845280855180835260408601915060408160051b8701019250838701855b82811015611d2157603f19888603018452611d70858351611bc3565b94509285019290850190600101611d54565b602081526000610fb66020830184611bc3565b63ffffffff8416815267ffffffffffffffff83166020820152606060408201526000611dc46060830184611bc3565b95945050505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715611df657611df6611f1f565b604052919050565b600067ffffffffffffffff821115611e1857611e18611f1f565b5060051b60200190565b600080821280156001600160ff1b0384900385131615611e4457611e44611f09565b600160ff1b8390038412811615611e5d57611e5d611f09565b50500190565b60008160040b8360040b82821282647fffffffff03821381151615611e8a57611e8a611f09565b82647fffffffff19038212811615611ea457611ea4611f09565b50019392505050565b600081810b83820b82821282607f03821381151615611ece57611ece611f09565b82607f19038212811615611ea457611ea4611f09565b600063ffffffff83811690831681811015611f0157611f01611f09565b039392505050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114611f4a57600080fd5b5056fea264697066735822122027163c9c7a018e3f491b10f71ff4861efc506503e9f39bd3fc08dc44e99cd34c64736f6c63430008040033`)
   284  
   285  	fileCreate, err := NewFileCreateTransaction().
   286  		SetKeys(env.OperatorKey.PublicKey()).
   287  		Execute(env.Client)
   288  	if err != nil {
   289  		return nil, err
   290  	}
   291  	fileCreate.SetValidateStatus(true)
   292  	receipt, err := fileCreate.GetReceipt(env.Client)
   293  	if err != nil {
   294  		return nil, err
   295  	}
   296  	fileAppend, err := NewFileAppendTransaction().SetFileID(*receipt.FileID).SetContents(bytecode).Execute(env.Client)
   297  	if err != nil {
   298  		return nil, err
   299  	}
   300  	fileAppend.SetValidateStatus(true)
   301  	_, err = fileAppend.GetReceipt(env.Client)
   302  	if err != nil {
   303  		return nil, err
   304  	}
   305  	contractCreate, err := NewContractCreateTransaction().
   306  		SetBytecodeFileID(*receipt.FileID).
   307  		SetGas(500000).Execute(env.Client)
   308  	if err != nil {
   309  		return nil, err
   310  	}
   311  	contractCreate.SetValidateStatus(true)
   312  	contractReceipt, err := contractCreate.GetReceipt(env.Client)
   313  	if err != nil {
   314  		return nil, err
   315  	}
   316  	return contractReceipt.ContractID, nil
   317  }
   318  
   319  func TestUint8Min(t *testing.T) {
   320  
   321  	env := NewIntegrationTestEnv(t)
   322  	deployContract(env)
   323  	value := uint8(0)
   324  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   325  		SetContractID(contractID).SetFunction("returnUint8", NewContractFunctionParameters().AddUint8(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   326  	require.NoError(t, err)
   327  	require.Equal(t, value, contractCal.GetUint8(0))
   328  	err = CloseIntegrationTestEnv(env, nil)
   329  	require.NoError(t, err)
   330  }
   331  func TestUint8Max(t *testing.T) {
   332  
   333  	env := NewIntegrationTestEnv(t)
   334  	deployContract(env)
   335  	value := uint8(255)
   336  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   337  		SetContractID(contractID).SetFunction("returnUint8", NewContractFunctionParameters().AddUint8(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   338  	require.NoError(t, err)
   339  	require.Equal(t, value, contractCal.GetUint8(0))
   340  	err = CloseIntegrationTestEnv(env, nil)
   341  	require.NoError(t, err)
   342  }
   343  
   344  func TestUint16Min(t *testing.T) {
   345  
   346  	env := NewIntegrationTestEnv(t)
   347  	deployContract(env)
   348  	value := uint16(0)
   349  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   350  		SetContractID(contractID).SetFunction("returnUint16", NewContractFunctionParameters().AddUint16(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   351  	require.NoError(t, err)
   352  	require.Equal(t, value, contractCal.GetUint16(0))
   353  	err = CloseIntegrationTestEnv(env, nil)
   354  	require.NoError(t, err)
   355  }
   356  func TestUint16Max(t *testing.T) {
   357  
   358  	env := NewIntegrationTestEnv(t)
   359  	deployContract(env)
   360  	value := uint16(65535)
   361  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   362  		SetContractID(contractID).SetFunction("returnUint16", NewContractFunctionParameters().AddUint16(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   363  	require.NoError(t, err)
   364  	require.Equal(t, value, contractCal.GetUint16(0))
   365  	err = CloseIntegrationTestEnv(env, nil)
   366  	require.NoError(t, err)
   367  }
   368  
   369  func TestUint24Min(t *testing.T) {
   370  
   371  	env := NewIntegrationTestEnv(t)
   372  	deployContract(env)
   373  	value := uint32(0)
   374  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   375  		SetContractID(contractID).SetFunction("returnUint24", NewContractFunctionParameters().AddUint24(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   376  	require.NoError(t, err)
   377  	require.Equal(t, value, contractCal.GetUint24(0))
   378  	err = CloseIntegrationTestEnv(env, nil)
   379  	require.NoError(t, err)
   380  }
   381  func TestUint24Max(t *testing.T) {
   382  
   383  	env := NewIntegrationTestEnv(t)
   384  	deployContract(env)
   385  	value := uint32(16777215)
   386  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   387  		SetContractID(contractID).SetFunction("returnUint24", NewContractFunctionParameters().AddUint24(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   388  	require.NoError(t, err)
   389  	require.Equal(t, value, contractCal.GetUint24(0))
   390  	err = CloseIntegrationTestEnv(env, nil)
   391  	require.NoError(t, err)
   392  }
   393  func TestUint32Min(t *testing.T) {
   394  
   395  	env := NewIntegrationTestEnv(t)
   396  	deployContract(env)
   397  	value := uint32(0)
   398  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   399  		SetContractID(contractID).SetFunction("returnUint32", NewContractFunctionParameters().AddUint32(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   400  	require.NoError(t, err)
   401  	require.Equal(t, value, contractCal.GetUint32(0))
   402  	err = CloseIntegrationTestEnv(env, nil)
   403  	require.NoError(t, err)
   404  }
   405  func TestUint32Max(t *testing.T) {
   406  
   407  	env := NewIntegrationTestEnv(t)
   408  	deployContract(env)
   409  	value := uint32(4294967295)
   410  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   411  		SetContractID(contractID).SetFunction("returnUint32", NewContractFunctionParameters().AddUint32(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   412  	require.NoError(t, err)
   413  	require.Equal(t, value, contractCal.GetUint32(0))
   414  	err = CloseIntegrationTestEnv(env, nil)
   415  	require.NoError(t, err)
   416  }
   417  
   418  func TestUint40Min(t *testing.T) {
   419  
   420  	env := NewIntegrationTestEnv(t)
   421  	deployContract(env)
   422  	value := uint64(0)
   423  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   424  		SetContractID(contractID).SetFunction("returnUint40", NewContractFunctionParameters().AddUint40(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   425  	require.NoError(t, err)
   426  	require.Equal(t, value, contractCal.GetUint40(0))
   427  	err = CloseIntegrationTestEnv(env, nil)
   428  	require.NoError(t, err)
   429  }
   430  func TestUint40Max(t *testing.T) {
   431  
   432  	env := NewIntegrationTestEnv(t)
   433  	deployContract(env)
   434  	value := uint64(109951162777)
   435  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   436  		SetContractID(contractID).SetFunction("returnUint40", NewContractFunctionParameters().AddUint40(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   437  	require.NoError(t, err)
   438  	require.Equal(t, value, contractCal.GetUint40(0))
   439  	err = CloseIntegrationTestEnv(env, nil)
   440  	require.NoError(t, err)
   441  }
   442  
   443  func TestUint48Min(t *testing.T) {
   444  
   445  	env := NewIntegrationTestEnv(t)
   446  	deployContract(env)
   447  	value := uint64(0)
   448  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   449  		SetContractID(contractID).SetFunction("returnUint48", NewContractFunctionParameters().AddUint48(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   450  	require.NoError(t, err)
   451  	require.Equal(t, value, contractCal.GetUint48(0))
   452  	err = CloseIntegrationTestEnv(env, nil)
   453  	require.NoError(t, err)
   454  }
   455  func TestUint48Max(t *testing.T) {
   456  
   457  	env := NewIntegrationTestEnv(t)
   458  	deployContract(env)
   459  	value := uint64(281474976710655)
   460  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   461  		SetContractID(contractID).SetFunction("returnUint48", NewContractFunctionParameters().AddUint48(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   462  	require.NoError(t, err)
   463  	require.Equal(t, value, contractCal.GetUint48(0))
   464  	err = CloseIntegrationTestEnv(env, nil)
   465  	require.NoError(t, err)
   466  }
   467  
   468  func TestUint56Min(t *testing.T) {
   469  
   470  	env := NewIntegrationTestEnv(t)
   471  	deployContract(env)
   472  	value := uint64(0)
   473  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   474  		SetContractID(contractID).SetFunction("returnUint56", NewContractFunctionParameters().AddUint56(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   475  	require.NoError(t, err)
   476  	require.Equal(t, value, contractCal.GetUint56(0))
   477  	err = CloseIntegrationTestEnv(env, nil)
   478  	require.NoError(t, err)
   479  }
   480  func TestUint56Max(t *testing.T) {
   481  
   482  	env := NewIntegrationTestEnv(t)
   483  	deployContract(env)
   484  	value := uint64(72057594037927935)
   485  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   486  		SetContractID(contractID).SetFunction("returnUint56", NewContractFunctionParameters().AddUint56(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   487  	require.NoError(t, err)
   488  	require.Equal(t, value, contractCal.GetUint56(0))
   489  	err = CloseIntegrationTestEnv(env, nil)
   490  	require.NoError(t, err)
   491  }
   492  
   493  func TestUint64Min(t *testing.T) {
   494  
   495  	env := NewIntegrationTestEnv(t)
   496  	deployContract(env)
   497  	value := uint64(0)
   498  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   499  		SetContractID(contractID).SetFunction("returnUint64", NewContractFunctionParameters().AddUint64(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   500  	require.NoError(t, err)
   501  	require.Equal(t, value, contractCal.GetUint64(0))
   502  	err = CloseIntegrationTestEnv(env, nil)
   503  	require.NoError(t, err)
   504  }
   505  func TestUint64Max(t *testing.T) {
   506  
   507  	env := NewIntegrationTestEnv(t)
   508  	deployContract(env)
   509  	value := uint64(9223372036854775807)
   510  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   511  		SetContractID(contractID).SetFunction("returnUint64", NewContractFunctionParameters().AddUint64(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   512  	require.NoError(t, err)
   513  	require.Equal(t, value, contractCal.GetUint64(0))
   514  	err = CloseIntegrationTestEnv(env, nil)
   515  	require.NoError(t, err)
   516  }
   517  
   518  func TestUint72Min(t *testing.T) {
   519  
   520  	env := NewIntegrationTestEnv(t)
   521  	deployContract(env)
   522  	intType(t, env, "uint72", "0")
   523  	err := CloseIntegrationTestEnv(env, nil)
   524  	require.NoError(t, err)
   525  }
   526  func TestUint72Max(t *testing.T) {
   527  
   528  	env := NewIntegrationTestEnv(t)
   529  	deployContract(env)
   530  	intType(t, env, "uint72", "4722366482869645213695")
   531  	err := CloseIntegrationTestEnv(env, nil)
   532  	require.NoError(t, err)
   533  }
   534  
   535  func TestUint80Min(t *testing.T) {
   536  
   537  	env := NewIntegrationTestEnv(t)
   538  	deployContract(env)
   539  	intType(t, env, "uint80", "0")
   540  	err := CloseIntegrationTestEnv(env, nil)
   541  	require.NoError(t, err)
   542  }
   543  func TestUint80Max(t *testing.T) {
   544  
   545  	env := NewIntegrationTestEnv(t)
   546  	deployContract(env)
   547  	intType(t, env, "uint80", "1208925819614629174706175")
   548  	err := CloseIntegrationTestEnv(env, nil)
   549  	require.NoError(t, err)
   550  }
   551  func TestUint88Min(t *testing.T) {
   552  
   553  	env := NewIntegrationTestEnv(t)
   554  	deployContract(env)
   555  	intType(t, env, "uint88", "0")
   556  	err := CloseIntegrationTestEnv(env, nil)
   557  	require.NoError(t, err)
   558  }
   559  func TestUint88Max(t *testing.T) {
   560  
   561  	env := NewIntegrationTestEnv(t)
   562  	deployContract(env)
   563  	intType(t, env, "uint88", "309485009821345068724781055")
   564  	err := CloseIntegrationTestEnv(env, nil)
   565  	require.NoError(t, err)
   566  }
   567  func TestUint96Min(t *testing.T) {
   568  
   569  	env := NewIntegrationTestEnv(t)
   570  	deployContract(env)
   571  	intType(t, env, "uint96", "0")
   572  	err := CloseIntegrationTestEnv(env, nil)
   573  	require.NoError(t, err)
   574  }
   575  func TestUint96Max(t *testing.T) {
   576  
   577  	env := NewIntegrationTestEnv(t)
   578  	deployContract(env)
   579  	intType(t, env, "uint96", "79228162514264337593543950335")
   580  	err := CloseIntegrationTestEnv(env, nil)
   581  	require.NoError(t, err)
   582  }
   583  func TestUint104Min(t *testing.T) {
   584  
   585  	env := NewIntegrationTestEnv(t)
   586  	deployContract(env)
   587  	intType(t, env, "uint104", "0")
   588  	err := CloseIntegrationTestEnv(env, nil)
   589  	require.NoError(t, err)
   590  }
   591  func TestUint104Max(t *testing.T) {
   592  
   593  	env := NewIntegrationTestEnv(t)
   594  	deployContract(env)
   595  	intType(t, env, "uint104", "20282409603651670423947251286015")
   596  	err := CloseIntegrationTestEnv(env, nil)
   597  	require.NoError(t, err)
   598  }
   599  
   600  func TestUint112Min(t *testing.T) {
   601  
   602  	env := NewIntegrationTestEnv(t)
   603  	deployContract(env)
   604  	intType(t, env, "uint112", "0")
   605  	err := CloseIntegrationTestEnv(env, nil)
   606  	require.NoError(t, err)
   607  }
   608  func TestUint112Max(t *testing.T) {
   609  
   610  	env := NewIntegrationTestEnv(t)
   611  	deployContract(env)
   612  	intType(t, env, "uint112", "5192296858534827628530496329220095")
   613  	err := CloseIntegrationTestEnv(env, nil)
   614  	require.NoError(t, err)
   615  }
   616  func TestUint120Min(t *testing.T) {
   617  
   618  	env := NewIntegrationTestEnv(t)
   619  	deployContract(env)
   620  	intType(t, env, "uint120", "0")
   621  	err := CloseIntegrationTestEnv(env, nil)
   622  	require.NoError(t, err)
   623  }
   624  func TestUint120Max(t *testing.T) {
   625  
   626  	env := NewIntegrationTestEnv(t)
   627  	deployContract(env)
   628  	intType(t, env, "uint120", "1329227995784915872903807060280344575")
   629  	err := CloseIntegrationTestEnv(env, nil)
   630  	require.NoError(t, err)
   631  }
   632  func TestUint128Min(t *testing.T) {
   633  
   634  	env := NewIntegrationTestEnv(t)
   635  	deployContract(env)
   636  	intType(t, env, "uint128", "0")
   637  	err := CloseIntegrationTestEnv(env, nil)
   638  	require.NoError(t, err)
   639  }
   640  func TestUint128Max(t *testing.T) {
   641  
   642  	env := NewIntegrationTestEnv(t)
   643  	deployContract(env)
   644  	intType(t, env, "uint128", "340282366920938463463374607431768211455")
   645  	err := CloseIntegrationTestEnv(env, nil)
   646  	require.NoError(t, err)
   647  }
   648  func TestUint136Min(t *testing.T) {
   649  
   650  	env := NewIntegrationTestEnv(t)
   651  	deployContract(env)
   652  	intType(t, env, "uint136", "0")
   653  	err := CloseIntegrationTestEnv(env, nil)
   654  	require.NoError(t, err)
   655  }
   656  func TestUint136Max(t *testing.T) {
   657  
   658  	env := NewIntegrationTestEnv(t)
   659  	deployContract(env)
   660  	intType(t, env, "uint136", "87112285931760246646623899502532662132735")
   661  	err := CloseIntegrationTestEnv(env, nil)
   662  	require.NoError(t, err)
   663  }
   664  func TestUint144Min(t *testing.T) {
   665  
   666  	env := NewIntegrationTestEnv(t)
   667  	deployContract(env)
   668  	intType(t, env, "uint144", "0")
   669  	err := CloseIntegrationTestEnv(env, nil)
   670  	require.NoError(t, err)
   671  }
   672  func TestUint144Max(t *testing.T) {
   673  
   674  	env := NewIntegrationTestEnv(t)
   675  	deployContract(env)
   676  	intType(t, env, "uint144", "22300745198530623141535718272648361505980415")
   677  	err := CloseIntegrationTestEnv(env, nil)
   678  	require.NoError(t, err)
   679  }
   680  func TestUint152Min(t *testing.T) {
   681  
   682  	env := NewIntegrationTestEnv(t)
   683  	deployContract(env)
   684  	intType(t, env, "uint152", "0")
   685  	err := CloseIntegrationTestEnv(env, nil)
   686  	require.NoError(t, err)
   687  }
   688  func TestUint152Max(t *testing.T) {
   689  
   690  	env := NewIntegrationTestEnv(t)
   691  	deployContract(env)
   692  	intType(t, env, "uint152", "5708990770823839524233143877797980545530986495")
   693  	err := CloseIntegrationTestEnv(env, nil)
   694  	require.NoError(t, err)
   695  }
   696  func TestUint160Min(t *testing.T) {
   697  
   698  	env := NewIntegrationTestEnv(t)
   699  	deployContract(env)
   700  	intType(t, env, "uint160", "0")
   701  	err := CloseIntegrationTestEnv(env, nil)
   702  	require.NoError(t, err)
   703  }
   704  func TestUint160Max(t *testing.T) {
   705  
   706  	env := NewIntegrationTestEnv(t)
   707  	deployContract(env)
   708  	intType(t, env, "uint160", "1461501637330902918203684832716283019655932542975")
   709  	err := CloseIntegrationTestEnv(env, nil)
   710  	require.NoError(t, err)
   711  }
   712  func TestUint168Min(t *testing.T) {
   713  
   714  	env := NewIntegrationTestEnv(t)
   715  	deployContract(env)
   716  	intType(t, env, "uint168", "0")
   717  	err := CloseIntegrationTestEnv(env, nil)
   718  	require.NoError(t, err)
   719  }
   720  func TestUint168Max(t *testing.T) {
   721  
   722  	env := NewIntegrationTestEnv(t)
   723  	deployContract(env)
   724  	intType(t, env, "uint168", "374144419156711147060143317175368453031918731001855")
   725  	err := CloseIntegrationTestEnv(env, nil)
   726  	require.NoError(t, err)
   727  }
   728  func TestUint176Min(t *testing.T) {
   729  
   730  	env := NewIntegrationTestEnv(t)
   731  	deployContract(env)
   732  	intType(t, env, "uint176", "0")
   733  	err := CloseIntegrationTestEnv(env, nil)
   734  	require.NoError(t, err)
   735  }
   736  func TestUint176Max(t *testing.T) {
   737  
   738  	env := NewIntegrationTestEnv(t)
   739  	deployContract(env)
   740  	intType(t, env, "uint176", "95780971304118053647396689196894323976171195136475135")
   741  	err := CloseIntegrationTestEnv(env, nil)
   742  	require.NoError(t, err)
   743  }
   744  func TestUint184Min(t *testing.T) {
   745  
   746  	env := NewIntegrationTestEnv(t)
   747  	deployContract(env)
   748  	intType(t, env, "uint184", "0")
   749  	err := CloseIntegrationTestEnv(env, nil)
   750  	require.NoError(t, err)
   751  }
   752  func TestUint184Max(t *testing.T) {
   753  
   754  	env := NewIntegrationTestEnv(t)
   755  	deployContract(env)
   756  	intType(t, env, "uint184", "24519928653854221733733552434404946937899825954937634815")
   757  	err := CloseIntegrationTestEnv(env, nil)
   758  	require.NoError(t, err)
   759  }
   760  func TestUint192Min(t *testing.T) {
   761  
   762  	env := NewIntegrationTestEnv(t)
   763  	deployContract(env)
   764  	intType(t, env, "uint192", "0")
   765  	err := CloseIntegrationTestEnv(env, nil)
   766  	require.NoError(t, err)
   767  }
   768  func TestUint192Max(t *testing.T) {
   769  
   770  	env := NewIntegrationTestEnv(t)
   771  	deployContract(env)
   772  	intType(t, env, "uint192", "6277101735386680763835789423207666416102355444464034512895")
   773  	err := CloseIntegrationTestEnv(env, nil)
   774  	require.NoError(t, err)
   775  }
   776  func TestUint200Min(t *testing.T) {
   777  
   778  	env := NewIntegrationTestEnv(t)
   779  	deployContract(env)
   780  	intType(t, env, "uint200", "0")
   781  	err := CloseIntegrationTestEnv(env, nil)
   782  	require.NoError(t, err)
   783  }
   784  func TestUint200Max(t *testing.T) {
   785  
   786  	env := NewIntegrationTestEnv(t)
   787  	deployContract(env)
   788  	intType(t, env, "uint200", "1606938044258990275541962092341162602522202993782792835301375")
   789  	err := CloseIntegrationTestEnv(env, nil)
   790  	require.NoError(t, err)
   791  }
   792  func TestUint208Min(t *testing.T) {
   793  
   794  	env := NewIntegrationTestEnv(t)
   795  	deployContract(env)
   796  	intType(t, env, "uint208", "0")
   797  	err := CloseIntegrationTestEnv(env, nil)
   798  	require.NoError(t, err)
   799  }
   800  func TestUint208Max(t *testing.T) {
   801  
   802  	env := NewIntegrationTestEnv(t)
   803  	deployContract(env)
   804  	intType(t, env, "uint208", "411376139330301510538742295639337626245683966408394965837152255")
   805  	err := CloseIntegrationTestEnv(env, nil)
   806  	require.NoError(t, err)
   807  }
   808  func TestUint216Min(t *testing.T) {
   809  
   810  	env := NewIntegrationTestEnv(t)
   811  	deployContract(env)
   812  	intType(t, env, "uint216", "0")
   813  	err := CloseIntegrationTestEnv(env, nil)
   814  	require.NoError(t, err)
   815  }
   816  func TestUint216Max(t *testing.T) {
   817  
   818  	env := NewIntegrationTestEnv(t)
   819  	deployContract(env)
   820  	intType(t, env, "uint216", "105312291668557186697918027683670432318895095400549111254310977535")
   821  	err := CloseIntegrationTestEnv(env, nil)
   822  	require.NoError(t, err)
   823  }
   824  func TestUint224Min(t *testing.T) {
   825  
   826  	env := NewIntegrationTestEnv(t)
   827  	deployContract(env)
   828  	intType(t, env, "uint224", "0")
   829  	err := CloseIntegrationTestEnv(env, nil)
   830  	require.NoError(t, err)
   831  }
   832  func TestUint224Max(t *testing.T) {
   833  
   834  	env := NewIntegrationTestEnv(t)
   835  	deployContract(env)
   836  	intType(t, env, "uint224", "26959946667150639794667015087019630673637144422540572481103610249215")
   837  	err := CloseIntegrationTestEnv(env, nil)
   838  	require.NoError(t, err)
   839  }
   840  func TestUint232Min(t *testing.T) {
   841  
   842  	env := NewIntegrationTestEnv(t)
   843  	deployContract(env)
   844  	intType(t, env, "uint232", "0")
   845  	err := CloseIntegrationTestEnv(env, nil)
   846  	require.NoError(t, err)
   847  }
   848  func TestUint232Max(t *testing.T) {
   849  
   850  	env := NewIntegrationTestEnv(t)
   851  	deployContract(env)
   852  	intType(t, env, "uint232", "6901746346790563787434755862277025452451108972170386555162524223799295")
   853  	err := CloseIntegrationTestEnv(env, nil)
   854  	require.NoError(t, err)
   855  }
   856  func TestUint240Min(t *testing.T) {
   857  
   858  	env := NewIntegrationTestEnv(t)
   859  	deployContract(env)
   860  	intType(t, env, "uint240", "0")
   861  	err := CloseIntegrationTestEnv(env, nil)
   862  	require.NoError(t, err)
   863  }
   864  func TestUint240Max(t *testing.T) {
   865  
   866  	env := NewIntegrationTestEnv(t)
   867  	deployContract(env)
   868  	intType(t, env, "uint240", "1766847064778384329583297500742918515827483896875618958121606201292619775")
   869  	err := CloseIntegrationTestEnv(env, nil)
   870  	require.NoError(t, err)
   871  }
   872  func TestUint248Min(t *testing.T) {
   873  
   874  	env := NewIntegrationTestEnv(t)
   875  	deployContract(env)
   876  	intType(t, env, "uint248", "0")
   877  	err := CloseIntegrationTestEnv(env, nil)
   878  	require.NoError(t, err)
   879  }
   880  func TestUint248Max(t *testing.T) {
   881  
   882  	env := NewIntegrationTestEnv(t)
   883  	deployContract(env)
   884  	intType(t, env, "uint248", "452312848583266388373324160190187140051835877600158453279131187530910662655")
   885  	err := CloseIntegrationTestEnv(env, nil)
   886  	require.NoError(t, err)
   887  }
   888  func TestUint256Min(t *testing.T) {
   889  
   890  	env := NewIntegrationTestEnv(t)
   891  	deployContract(env)
   892  	intType(t, env, "uint256", "0")
   893  	err := CloseIntegrationTestEnv(env, nil)
   894  	require.NoError(t, err)
   895  }
   896  func TestUint256Max(t *testing.T) {
   897  
   898  	env := NewIntegrationTestEnv(t)
   899  	deployContract(env)
   900  	intType(t, env, "uint256", "115792089237316195423570985008687907853269984665640564039457584007913129639935")
   901  	err := CloseIntegrationTestEnv(env, nil)
   902  	require.NoError(t, err)
   903  }
   904  
   905  func TestInt8Min(t *testing.T) {
   906  
   907  	env := NewIntegrationTestEnv(t)
   908  	deployContract(env)
   909  	value := int8(-128)
   910  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   911  		SetContractID(contractID).SetFunction("returnInt8", NewContractFunctionParameters().AddInt8(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   912  	require.NoError(t, err)
   913  	require.Equal(t, value, contractCal.GetInt8(0))
   914  	err = CloseIntegrationTestEnv(env, nil)
   915  	require.NoError(t, err)
   916  }
   917  func TestInt8Max(t *testing.T) {
   918  
   919  	env := NewIntegrationTestEnv(t)
   920  	deployContract(env)
   921  	value := int8(127)
   922  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   923  		SetContractID(contractID).SetFunction("returnInt8", NewContractFunctionParameters().AddInt8(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   924  	require.NoError(t, err)
   925  	require.Equal(t, value, contractCal.GetInt8(0))
   926  	err = CloseIntegrationTestEnv(env, nil)
   927  	require.NoError(t, err)
   928  }
   929  
   930  func TestInt16Min(t *testing.T) {
   931  
   932  	env := NewIntegrationTestEnv(t)
   933  	deployContract(env)
   934  	value := int16(-32768)
   935  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   936  		SetContractID(contractID).SetFunction("returnInt16", NewContractFunctionParameters().AddInt16(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   937  	require.NoError(t, err)
   938  	require.Equal(t, value, contractCal.GetInt16(0))
   939  	err = CloseIntegrationTestEnv(env, nil)
   940  	require.NoError(t, err)
   941  }
   942  func TestInt16Max(t *testing.T) {
   943  
   944  	env := NewIntegrationTestEnv(t)
   945  	deployContract(env)
   946  	value := int16(32767)
   947  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   948  		SetContractID(contractID).SetFunction("returnInt16", NewContractFunctionParameters().AddInt16(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   949  	require.NoError(t, err)
   950  	require.Equal(t, value, contractCal.GetInt16(0))
   951  	err = CloseIntegrationTestEnv(env, nil)
   952  	require.NoError(t, err)
   953  }
   954  
   955  func TestInt24Min(t *testing.T) {
   956  
   957  	env := NewIntegrationTestEnv(t)
   958  	deployContract(env)
   959  	value := int32(-8388608)
   960  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   961  		SetContractID(contractID).SetFunction("returnInt24", NewContractFunctionParameters().AddInt24(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   962  	require.NoError(t, err)
   963  	require.Equal(t, value, contractCal.GetInt24(0))
   964  	err = CloseIntegrationTestEnv(env, nil)
   965  	require.NoError(t, err)
   966  }
   967  func TestInt24Max(t *testing.T) {
   968  
   969  	env := NewIntegrationTestEnv(t)
   970  	deployContract(env)
   971  	value := int32(8388607)
   972  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   973  		SetContractID(contractID).SetFunction("returnInt24", NewContractFunctionParameters().AddInt24(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   974  	require.NoError(t, err)
   975  	require.Equal(t, value, contractCal.GetInt24(0))
   976  	err = CloseIntegrationTestEnv(env, nil)
   977  	require.NoError(t, err)
   978  }
   979  func TestInt32Min(t *testing.T) {
   980  
   981  	env := NewIntegrationTestEnv(t)
   982  	deployContract(env)
   983  	value := int32(-2147483648)
   984  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   985  		SetContractID(contractID).SetFunction("returnInt32", NewContractFunctionParameters().AddInt32(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   986  	require.NoError(t, err)
   987  	require.Equal(t, value, contractCal.GetInt32(0))
   988  	err = CloseIntegrationTestEnv(env, nil)
   989  	require.NoError(t, err)
   990  }
   991  func TestInt32Max(t *testing.T) {
   992  
   993  	env := NewIntegrationTestEnv(t)
   994  	deployContract(env)
   995  	value := int32(2147483647)
   996  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
   997  		SetContractID(contractID).SetFunction("returnInt32", NewContractFunctionParameters().AddInt32(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
   998  	require.NoError(t, err)
   999  	require.Equal(t, value, contractCal.GetInt32(0))
  1000  	err = CloseIntegrationTestEnv(env, nil)
  1001  	require.NoError(t, err)
  1002  }
  1003  
  1004  func TestInt40Min(t *testing.T) {
  1005  
  1006  	env := NewIntegrationTestEnv(t)
  1007  	deployContract(env)
  1008  	value := int64(-549755813888)
  1009  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1010  		SetContractID(contractID).SetFunction("returnInt40", NewContractFunctionParameters().AddInt40(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
  1011  	require.NoError(t, err)
  1012  	require.Equal(t, int64(value), contractCal.GetInt40(0))
  1013  	err = CloseIntegrationTestEnv(env, nil)
  1014  	require.NoError(t, err)
  1015  }
  1016  func TestInt40Max(t *testing.T) {
  1017  
  1018  	env := NewIntegrationTestEnv(t)
  1019  	deployContract(env)
  1020  	value := int64(549755813887)
  1021  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1022  		SetContractID(contractID).SetFunction("returnInt40", NewContractFunctionParameters().AddInt40(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
  1023  	require.NoError(t, err)
  1024  	require.Equal(t, int64(value), contractCal.GetInt40(0))
  1025  	err = CloseIntegrationTestEnv(env, nil)
  1026  	require.NoError(t, err)
  1027  }
  1028  
  1029  func TestInt48Min(t *testing.T) {
  1030  
  1031  	env := NewIntegrationTestEnv(t)
  1032  	deployContract(env)
  1033  	value := int64(-140737488355328)
  1034  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1035  		SetContractID(contractID).SetFunction("returnInt48", NewContractFunctionParameters().AddInt48(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
  1036  	require.NoError(t, err)
  1037  	require.Equal(t, int64(value), contractCal.GetInt48(0))
  1038  	err = CloseIntegrationTestEnv(env, nil)
  1039  	require.NoError(t, err)
  1040  }
  1041  func TestInt48Max(t *testing.T) {
  1042  
  1043  	env := NewIntegrationTestEnv(t)
  1044  	deployContract(env)
  1045  	value := int64(140737488355327)
  1046  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1047  		SetContractID(contractID).SetFunction("returnInt48", NewContractFunctionParameters().AddInt48(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
  1048  	require.NoError(t, err)
  1049  	require.Equal(t, int64(value), contractCal.GetInt48(0))
  1050  	err = CloseIntegrationTestEnv(env, nil)
  1051  	require.NoError(t, err)
  1052  }
  1053  
  1054  func TestInt56Min(t *testing.T) {
  1055  
  1056  	env := NewIntegrationTestEnv(t)
  1057  	deployContract(env)
  1058  	value := int64(-36028797018963968)
  1059  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1060  		SetContractID(contractID).SetFunction("returnInt56", NewContractFunctionParameters().AddInt56(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
  1061  	require.NoError(t, err)
  1062  	require.Equal(t, value, contractCal.GetInt56(0))
  1063  	err = CloseIntegrationTestEnv(env, nil)
  1064  	require.NoError(t, err)
  1065  }
  1066  func TestInt56Max(t *testing.T) {
  1067  
  1068  	env := NewIntegrationTestEnv(t)
  1069  	deployContract(env)
  1070  	value := int64(36028797018963967)
  1071  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1072  		SetContractID(contractID).SetFunction("returnInt56", NewContractFunctionParameters().AddInt56(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
  1073  	require.NoError(t, err)
  1074  	require.Equal(t, value, contractCal.GetInt56(0))
  1075  	err = CloseIntegrationTestEnv(env, nil)
  1076  	require.NoError(t, err)
  1077  }
  1078  
  1079  func TestInt64Min(t *testing.T) {
  1080  
  1081  	env := NewIntegrationTestEnv(t)
  1082  	deployContract(env)
  1083  	value := int64(-9223372036854775808)
  1084  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1085  		SetContractID(contractID).SetFunction("returnInt64", NewContractFunctionParameters().AddInt64(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
  1086  	require.NoError(t, err)
  1087  	require.Equal(t, value, contractCal.GetInt64(0))
  1088  	err = CloseIntegrationTestEnv(env, nil)
  1089  	require.NoError(t, err)
  1090  }
  1091  func TestInt64Max(t *testing.T) {
  1092  
  1093  	env := NewIntegrationTestEnv(t)
  1094  	deployContract(env)
  1095  	value := int64(9223372036854775807)
  1096  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1097  		SetContractID(contractID).SetFunction("returnInt64", NewContractFunctionParameters().AddInt64(value)).SetMaxQueryPayment(NewHbar(20)).Execute(env.Client)
  1098  	require.NoError(t, err)
  1099  	require.Equal(t, value, contractCal.GetInt64(0))
  1100  	err = CloseIntegrationTestEnv(env, nil)
  1101  	require.NoError(t, err)
  1102  }
  1103  
  1104  func TestInt72Min(t *testing.T) {
  1105  
  1106  	env := NewIntegrationTestEnv(t)
  1107  	deployContract(env)
  1108  	intType(t, env, "int72", "-2361183241434822606848")
  1109  	err := CloseIntegrationTestEnv(env, nil)
  1110  	require.NoError(t, err)
  1111  }
  1112  
  1113  func TestInt72Max(t *testing.T) {
  1114  
  1115  	env := NewIntegrationTestEnv(t)
  1116  	deployContract(env)
  1117  	intType(t, env, "int72", "2361183241434822606847")
  1118  	err := CloseIntegrationTestEnv(env, nil)
  1119  	require.NoError(t, err)
  1120  }
  1121  
  1122  func TestInt80Min(t *testing.T) {
  1123  
  1124  	env := NewIntegrationTestEnv(t)
  1125  	deployContract(env)
  1126  	intType(t, env, "int80", "-604462909807314587353088")
  1127  	err := CloseIntegrationTestEnv(env, nil)
  1128  	require.NoError(t, err)
  1129  }
  1130  
  1131  func TestInt80Max(t *testing.T) {
  1132  
  1133  	env := NewIntegrationTestEnv(t)
  1134  	deployContract(env)
  1135  	intType(t, env, "int80", "604462909807314587353087")
  1136  	err := CloseIntegrationTestEnv(env, nil)
  1137  	require.NoError(t, err)
  1138  }
  1139  
  1140  func TestInt88Min(t *testing.T) {
  1141  
  1142  	env := NewIntegrationTestEnv(t)
  1143  	deployContract(env)
  1144  	intType(t, env, "int88", "-154742504910672534362390528")
  1145  	err := CloseIntegrationTestEnv(env, nil)
  1146  	require.NoError(t, err)
  1147  }
  1148  
  1149  func TestInt88Max(t *testing.T) {
  1150  
  1151  	env := NewIntegrationTestEnv(t)
  1152  	deployContract(env)
  1153  	intType(t, env, "int88", "154742504910672534362390527")
  1154  	err := CloseIntegrationTestEnv(env, nil)
  1155  	require.NoError(t, err)
  1156  }
  1157  
  1158  func TestInt96Min(t *testing.T) {
  1159  
  1160  	env := NewIntegrationTestEnv(t)
  1161  	deployContract(env)
  1162  	intType(t, env, "int96", "-39614081257132168796771975168")
  1163  	err := CloseIntegrationTestEnv(env, nil)
  1164  	require.NoError(t, err)
  1165  }
  1166  
  1167  func TestInt96Max(t *testing.T) {
  1168  
  1169  	env := NewIntegrationTestEnv(t)
  1170  	deployContract(env)
  1171  	intType(t, env, "int96", "39614081257132168796771975167")
  1172  	err := CloseIntegrationTestEnv(env, nil)
  1173  	require.NoError(t, err)
  1174  }
  1175  
  1176  func TestInt104Min(t *testing.T) {
  1177  
  1178  	env := NewIntegrationTestEnv(t)
  1179  	deployContract(env)
  1180  	intType(t, env, "int104", "-10141204801825835211973625643008")
  1181  	err := CloseIntegrationTestEnv(env, nil)
  1182  	require.NoError(t, err)
  1183  }
  1184  
  1185  func TestInt104Max(t *testing.T) {
  1186  
  1187  	env := NewIntegrationTestEnv(t)
  1188  	deployContract(env)
  1189  	intType(t, env, "int104", "10141204801825835211973625643007")
  1190  	err := CloseIntegrationTestEnv(env, nil)
  1191  	require.NoError(t, err)
  1192  }
  1193  
  1194  func TestInt112Min(t *testing.T) {
  1195  
  1196  	env := NewIntegrationTestEnv(t)
  1197  	deployContract(env)
  1198  	intType(t, env, "int112", "-2596148429267413814265248164610048")
  1199  	err := CloseIntegrationTestEnv(env, nil)
  1200  	require.NoError(t, err)
  1201  }
  1202  
  1203  func TestInt112Max(t *testing.T) {
  1204  
  1205  	env := NewIntegrationTestEnv(t)
  1206  	deployContract(env)
  1207  	intType(t, env, "int112", "2596148429267413814265248164610047")
  1208  	err := CloseIntegrationTestEnv(env, nil)
  1209  	require.NoError(t, err)
  1210  }
  1211  
  1212  func TestInt120Min(t *testing.T) {
  1213  
  1214  	env := NewIntegrationTestEnv(t)
  1215  	deployContract(env)
  1216  	intType(t, env, "int120", "-664613997892457936451903530140172288")
  1217  	err := CloseIntegrationTestEnv(env, nil)
  1218  	require.NoError(t, err)
  1219  }
  1220  
  1221  func TestInt120Max(t *testing.T) {
  1222  
  1223  	env := NewIntegrationTestEnv(t)
  1224  	deployContract(env)
  1225  	intType(t, env, "int120", "664613997892457936451903530140172287")
  1226  	err := CloseIntegrationTestEnv(env, nil)
  1227  	require.NoError(t, err)
  1228  }
  1229  
  1230  func TestInt128Min(t *testing.T) {
  1231  
  1232  	env := NewIntegrationTestEnv(t)
  1233  	deployContract(env)
  1234  	intType(t, env, "int128", "-170141183460469231731687303715884105728")
  1235  	err := CloseIntegrationTestEnv(env, nil)
  1236  	require.NoError(t, err)
  1237  }
  1238  
  1239  func TestInt128Max(t *testing.T) {
  1240  
  1241  	env := NewIntegrationTestEnv(t)
  1242  	deployContract(env)
  1243  	intType(t, env, "int128", "170141183460469231731687303715884105727")
  1244  	err := CloseIntegrationTestEnv(env, nil)
  1245  	require.NoError(t, err)
  1246  }
  1247  
  1248  func TestInt136Min(t *testing.T) {
  1249  
  1250  	env := NewIntegrationTestEnv(t)
  1251  	deployContract(env)
  1252  	intType(t, env, "int136", "-43556142965880123323311949751266331066368")
  1253  	err := CloseIntegrationTestEnv(env, nil)
  1254  	require.NoError(t, err)
  1255  }
  1256  
  1257  func TestInt136Max(t *testing.T) {
  1258  
  1259  	env := NewIntegrationTestEnv(t)
  1260  	deployContract(env)
  1261  	intType(t, env, "int136", "43556142965880123323311949751266331066367")
  1262  	err := CloseIntegrationTestEnv(env, nil)
  1263  	require.NoError(t, err)
  1264  }
  1265  
  1266  func TestInt144Min(t *testing.T) {
  1267  
  1268  	env := NewIntegrationTestEnv(t)
  1269  	deployContract(env)
  1270  	intType(t, env, "int144", "-11150372599265311570767859136324180752990208")
  1271  	err := CloseIntegrationTestEnv(env, nil)
  1272  	require.NoError(t, err)
  1273  }
  1274  
  1275  func TestInt144Max(t *testing.T) {
  1276  
  1277  	env := NewIntegrationTestEnv(t)
  1278  	deployContract(env)
  1279  	intType(t, env, "int144", "11150372599265311570767859136324180752990207")
  1280  	err := CloseIntegrationTestEnv(env, nil)
  1281  	require.NoError(t, err)
  1282  }
  1283  
  1284  func TestInt152Min(t *testing.T) {
  1285  
  1286  	env := NewIntegrationTestEnv(t)
  1287  	deployContract(env)
  1288  	intType(t, env, "int152", "-2854495385411919762116571938898990272765493248")
  1289  	err := CloseIntegrationTestEnv(env, nil)
  1290  	require.NoError(t, err)
  1291  }
  1292  
  1293  func TestInt152Max(t *testing.T) {
  1294  
  1295  	env := NewIntegrationTestEnv(t)
  1296  	deployContract(env)
  1297  	intType(t, env, "int152", "2854495385411919762116571938898990272765493247")
  1298  	err := CloseIntegrationTestEnv(env, nil)
  1299  	require.NoError(t, err)
  1300  }
  1301  
  1302  func TestInt160Min(t *testing.T) {
  1303  
  1304  	env := NewIntegrationTestEnv(t)
  1305  	deployContract(env)
  1306  	intType(t, env, "int160", "-730750818665451459101842416358141509827966271488")
  1307  	err := CloseIntegrationTestEnv(env, nil)
  1308  	require.NoError(t, err)
  1309  }
  1310  
  1311  func TestInt160Max(t *testing.T) {
  1312  
  1313  	env := NewIntegrationTestEnv(t)
  1314  	deployContract(env)
  1315  	intType(t, env, "int160", "730750818665451459101842416358141509827966271487")
  1316  	err := CloseIntegrationTestEnv(env, nil)
  1317  	require.NoError(t, err)
  1318  }
  1319  
  1320  func TestInt168Min(t *testing.T) {
  1321  
  1322  	env := NewIntegrationTestEnv(t)
  1323  	deployContract(env)
  1324  	intType(t, env, "int168", "-187072209578355573530071658587684226515959365500928")
  1325  	err := CloseIntegrationTestEnv(env, nil)
  1326  	require.NoError(t, err)
  1327  }
  1328  
  1329  func TestInt168Max(t *testing.T) {
  1330  
  1331  	env := NewIntegrationTestEnv(t)
  1332  	deployContract(env)
  1333  	intType(t, env, "int168", "187072209578355573530071658587684226515959365500927")
  1334  	err := CloseIntegrationTestEnv(env, nil)
  1335  	require.NoError(t, err)
  1336  }
  1337  
  1338  func TestInt176Min(t *testing.T) {
  1339  
  1340  	env := NewIntegrationTestEnv(t)
  1341  	deployContract(env)
  1342  	intType(t, env, "int176", "-47890485652059026823698344598447161988085597568237568")
  1343  	err := CloseIntegrationTestEnv(env, nil)
  1344  	require.NoError(t, err)
  1345  }
  1346  
  1347  func TestInt176Max(t *testing.T) {
  1348  
  1349  	env := NewIntegrationTestEnv(t)
  1350  	deployContract(env)
  1351  	intType(t, env, "int176", "47890485652059026823698344598447161988085597568237567")
  1352  	err := CloseIntegrationTestEnv(env, nil)
  1353  	require.NoError(t, err)
  1354  }
  1355  
  1356  func TestInt184Min(t *testing.T) {
  1357  
  1358  	env := NewIntegrationTestEnv(t)
  1359  	deployContract(env)
  1360  	intType(t, env, "int184", "-12259964326927110866866776217202473468949912977468817408")
  1361  	err := CloseIntegrationTestEnv(env, nil)
  1362  	require.NoError(t, err)
  1363  }
  1364  
  1365  func TestInt184Max(t *testing.T) {
  1366  
  1367  	env := NewIntegrationTestEnv(t)
  1368  	deployContract(env)
  1369  	intType(t, env, "int184", "12259964326927110866866776217202473468949912977468817407")
  1370  	err := CloseIntegrationTestEnv(env, nil)
  1371  	require.NoError(t, err)
  1372  }
  1373  
  1374  func TestInt192Min(t *testing.T) {
  1375  
  1376  	env := NewIntegrationTestEnv(t)
  1377  	deployContract(env)
  1378  	intType(t, env, "int192", "-3138550867693340381917894711603833208051177722232017256448")
  1379  	err := CloseIntegrationTestEnv(env, nil)
  1380  	require.NoError(t, err)
  1381  }
  1382  
  1383  func TestInt192Max(t *testing.T) {
  1384  
  1385  	env := NewIntegrationTestEnv(t)
  1386  	deployContract(env)
  1387  	intType(t, env, "int192", "3138550867693340381917894711603833208051177722232017256447")
  1388  	err := CloseIntegrationTestEnv(env, nil)
  1389  	require.NoError(t, err)
  1390  }
  1391  
  1392  func TestInt200Min(t *testing.T) {
  1393  
  1394  	env := NewIntegrationTestEnv(t)
  1395  	deployContract(env)
  1396  	intType(t, env, "int200", "-803469022129495137770981046170581301261101496891396417650688")
  1397  	err := CloseIntegrationTestEnv(env, nil)
  1398  	require.NoError(t, err)
  1399  }
  1400  
  1401  func TestInt200Max(t *testing.T) {
  1402  
  1403  	env := NewIntegrationTestEnv(t)
  1404  	deployContract(env)
  1405  	intType(t, env, "int200", "803469022129495137770981046170581301261101496891396417650687")
  1406  	err := CloseIntegrationTestEnv(env, nil)
  1407  	require.NoError(t, err)
  1408  }
  1409  
  1410  func TestInt208Min(t *testing.T) {
  1411  
  1412  	env := NewIntegrationTestEnv(t)
  1413  	deployContract(env)
  1414  	intType(t, env, "int208", "-205688069665150755269371147819668813122841983204197482918576128")
  1415  	err := CloseIntegrationTestEnv(env, nil)
  1416  	require.NoError(t, err)
  1417  }
  1418  
  1419  func TestInt208Max(t *testing.T) {
  1420  
  1421  	env := NewIntegrationTestEnv(t)
  1422  	deployContract(env)
  1423  	intType(t, env, "int208", "205688069665150755269371147819668813122841983204197482918576127")
  1424  	err := CloseIntegrationTestEnv(env, nil)
  1425  	require.NoError(t, err)
  1426  }
  1427  
  1428  func TestInt216Min(t *testing.T) {
  1429  
  1430  	env := NewIntegrationTestEnv(t)
  1431  	deployContract(env)
  1432  	intType(t, env, "int216", "-52656145834278593348959013841835216159447547700274555627155488768")
  1433  	err := CloseIntegrationTestEnv(env, nil)
  1434  	require.NoError(t, err)
  1435  }
  1436  
  1437  func TestInt216Max(t *testing.T) {
  1438  
  1439  	env := NewIntegrationTestEnv(t)
  1440  	deployContract(env)
  1441  	intType(t, env, "int216", "52656145834278593348959013841835216159447547700274555627155488767")
  1442  	err := CloseIntegrationTestEnv(env, nil)
  1443  	require.NoError(t, err)
  1444  }
  1445  
  1446  func TestInt224Min(t *testing.T) {
  1447  
  1448  	env := NewIntegrationTestEnv(t)
  1449  	deployContract(env)
  1450  	intType(t, env, "int224", "-13479973333575319897333507543509815336818572211270286240551805124608")
  1451  	err := CloseIntegrationTestEnv(env, nil)
  1452  	require.NoError(t, err)
  1453  }
  1454  
  1455  func TestInt224Max(t *testing.T) {
  1456  
  1457  	env := NewIntegrationTestEnv(t)
  1458  	deployContract(env)
  1459  	intType(t, env, "int224", "13479973333575319897333507543509815336818572211270286240551805124607")
  1460  	err := CloseIntegrationTestEnv(env, nil)
  1461  	require.NoError(t, err)
  1462  }
  1463  
  1464  func TestInt232Min(t *testing.T) {
  1465  
  1466  	env := NewIntegrationTestEnv(t)
  1467  	deployContract(env)
  1468  	intType(t, env, "int232", "-3450873173395281893717377931138512726225554486085193277581262111899648")
  1469  	err := CloseIntegrationTestEnv(env, nil)
  1470  	require.NoError(t, err)
  1471  }
  1472  
  1473  func TestInt232Max(t *testing.T) {
  1474  
  1475  	env := NewIntegrationTestEnv(t)
  1476  	deployContract(env)
  1477  	intType(t, env, "int232", "3450873173395281893717377931138512726225554486085193277581262111899647")
  1478  	err := CloseIntegrationTestEnv(env, nil)
  1479  	require.NoError(t, err)
  1480  }
  1481  
  1482  func TestInt240Min(t *testing.T) {
  1483  
  1484  	env := NewIntegrationTestEnv(t)
  1485  	deployContract(env)
  1486  	intType(t, env, "int240", "-883423532389192164791648750371459257913741948437809479060803100646309888")
  1487  	err := CloseIntegrationTestEnv(env, nil)
  1488  	require.NoError(t, err)
  1489  }
  1490  
  1491  func TestInt240Max(t *testing.T) {
  1492  
  1493  	env := NewIntegrationTestEnv(t)
  1494  	deployContract(env)
  1495  	intType(t, env, "int240", "883423532389192164791648750371459257913741948437809479060803100646309887")
  1496  	err := CloseIntegrationTestEnv(env, nil)
  1497  	require.NoError(t, err)
  1498  }
  1499  
  1500  func TestInt248Min(t *testing.T) {
  1501  
  1502  	env := NewIntegrationTestEnv(t)
  1503  	deployContract(env)
  1504  	intType(t, env, "int248", "-226156424291633194186662080095093570025917938800079226639565593765455331328")
  1505  	err := CloseIntegrationTestEnv(env, nil)
  1506  	require.NoError(t, err)
  1507  }
  1508  
  1509  func TestInt248Max(t *testing.T) {
  1510  
  1511  	env := NewIntegrationTestEnv(t)
  1512  	deployContract(env)
  1513  	intType(t, env, "int248", "226156424291633194186662080095093570025917938800079226639565593765455331327")
  1514  	err := CloseIntegrationTestEnv(env, nil)
  1515  	require.NoError(t, err)
  1516  }
  1517  
  1518  func TestInt256Min(t *testing.T) {
  1519  
  1520  	env := NewIntegrationTestEnv(t)
  1521  	deployContract(env)
  1522  	intType(t, env, "int256", "-57896044618658097711785492504343953926634992332820282019728792003956564819968")
  1523  	err := CloseIntegrationTestEnv(env, nil)
  1524  	require.NoError(t, err)
  1525  }
  1526  
  1527  func TestInt256Max(t *testing.T) {
  1528  
  1529  	env := NewIntegrationTestEnv(t)
  1530  	deployContract(env)
  1531  	intType(t, env, "int256", "57896044618658097711785492504343953926634992332820282019728792003956564819967")
  1532  	err := CloseIntegrationTestEnv(env, nil)
  1533  	require.NoError(t, err)
  1534  }
  1535  
  1536  func TestMultipleInt8(t *testing.T) {
  1537  
  1538  	env := NewIntegrationTestEnv(t)
  1539  	deployContract(env)
  1540  	value := int8(-128)
  1541  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1542  		SetContractID(contractID).SetFunction("returnInt8Multiple", NewContractFunctionParameters().AddInt8(value)).Execute(env.Client)
  1543  	require.NoError(t, err)
  1544  	require.Equal(t, value, contractCal.GetInt8(0))
  1545  	require.Equal(t, int8(-108), contractCal.GetInt8(1))
  1546  	err = CloseIntegrationTestEnv(env, nil)
  1547  	require.NoError(t, err)
  1548  }
  1549  func TestMultipleInt40(t *testing.T) {
  1550  
  1551  	env := NewIntegrationTestEnv(t)
  1552  	deployContract(env)
  1553  	value := int64(549755813885)
  1554  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1555  		SetContractID(contractID).SetFunction("returnMultipleInt40", NewContractFunctionParameters().AddInt40(value)).Execute(env.Client)
  1556  	require.NoError(t, err)
  1557  	require.Equal(t, int64(549755813885), contractCal.GetInt40(0))
  1558  	require.Equal(t, int64(549755813886), contractCal.GetInt40(1))
  1559  	err = CloseIntegrationTestEnv(env, nil)
  1560  	require.NoError(t, err)
  1561  }
  1562  func TestMultipleInt256(t *testing.T) {
  1563  
  1564  	env := NewIntegrationTestEnv(t)
  1565  	deployContract(env)
  1566  	value, ok := new(big.Int).SetString("-123", 10)
  1567  	require.True(t, ok)
  1568  	valueTwos := math.U256Bytes(value)
  1569  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1570  		SetContractID(contractID).SetFunction("returnMultipleInt256", NewContractFunctionParameters().AddInt256(valueTwos)).Execute(env.Client)
  1571  	require.NoError(t, err)
  1572  	value1, ok := new(big.Int).SetString("-123", 10)
  1573  	require.True(t, ok)
  1574  	value2, ok := new(big.Int).SetString("-122", 10)
  1575  	require.True(t, ok)
  1576  	require.Equal(t, math.U256Bytes(value1), contractCal.GetInt256(0))
  1577  	require.Equal(t, math.U256Bytes(value2), contractCal.GetInt256(1))
  1578  	err = CloseIntegrationTestEnv(env, nil)
  1579  	require.NoError(t, err)
  1580  }
  1581  
  1582  func TestMultipleTypes(t *testing.T) {
  1583  
  1584  	env := NewIntegrationTestEnv(t)
  1585  	deployContract(env)
  1586  	value := uint32(4294967295)
  1587  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1588  		SetContractID(contractID).SetFunction("returnMultipleTypeParams", NewContractFunctionParameters().AddUint32(value)).Execute(env.Client)
  1589  	require.NoError(t, err)
  1590  	require.Equal(t, value, contractCal.GetUint32(0))
  1591  	require.Equal(t, uint64(4294967294), contractCal.GetUint64(1))
  1592  	require.Equal(t, "OK", contractCal.GetString(2))
  1593  	err = CloseIntegrationTestEnv(env, nil)
  1594  	require.NoError(t, err)
  1595  }
  1596  
  1597  func TestBigInt256(t *testing.T) {
  1598  
  1599  	env := NewIntegrationTestEnv(t)
  1600  	deployContract(env)
  1601  	value, ok := new(big.Int).SetString("-123", 10)
  1602  	require.True(t, ok)
  1603  
  1604  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1605  		SetContractID(contractID).SetFunction("returnInt256", NewContractFunctionParameters().AddInt256BigInt(value)).Execute(env.Client)
  1606  	require.NoError(t, err)
  1607  	require.Equal(t, value, contractCal.GetBigInt(0))
  1608  	err = CloseIntegrationTestEnv(env, nil)
  1609  	require.NoError(t, err)
  1610  }
  1611  
  1612  func TestBigUint256(t *testing.T) {
  1613  
  1614  	env := NewIntegrationTestEnv(t)
  1615  	deployContract(env)
  1616  	value, ok := new(big.Int).SetString("123", 10)
  1617  	require.True(t, ok)
  1618  
  1619  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1620  		SetContractID(contractID).SetFunction("returnUint256", NewContractFunctionParameters().AddUint256BigInt(value)).Execute(env.Client)
  1621  	require.NoError(t, err)
  1622  	require.Equal(t, value, contractCal.GetBigInt(0))
  1623  	err = CloseIntegrationTestEnv(env, nil)
  1624  	require.NoError(t, err)
  1625  }
  1626  
  1627  func TestMultiplBigInt256(t *testing.T) {
  1628  
  1629  	env := NewIntegrationTestEnv(t)
  1630  	deployContract(env)
  1631  	value, ok := new(big.Int).SetString("-123", 10)
  1632  	require.True(t, ok)
  1633  
  1634  	contractCal, err := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1635  		SetContractID(contractID).SetFunction("returnMultipleInt256", NewContractFunctionParameters().AddInt256BigInt(value)).Execute(env.Client)
  1636  	require.NoError(t, err)
  1637  	require.Equal(t, value, contractCal.GetBigInt(0))
  1638  	require.Equal(t, new(big.Int).Add(value, big.NewInt(1)), contractCal.GetBigInt(1))
  1639  	err = CloseIntegrationTestEnv(env, nil)
  1640  	require.NoError(t, err)
  1641  }
  1642  func TestString(t *testing.T) {
  1643  
  1644  	env := NewIntegrationTestEnv(t)
  1645  	deployContract(env)
  1646  	value := "Test"
  1647  
  1648  	contractCal := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1649  		SetContractID(contractID).SetFunction("returnString", NewContractFunctionParameters().AddString(value))
  1650  	result, err := contractCal.Execute(env.Client)
  1651  	require.NoError(t, err)
  1652  	require.Equal(t, value, result.GetString(0))
  1653  	err = CloseIntegrationTestEnv(env, nil)
  1654  	require.NoError(t, err)
  1655  }
  1656  
  1657  func TestStringArray(t *testing.T) {
  1658  
  1659  	env := NewIntegrationTestEnv(t)
  1660  	deployContract(env)
  1661  	value := []string{"Test1", "Test2"}
  1662  
  1663  	contractCal := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1664  		SetContractID(contractID).SetFunction("returnStringArr", NewContractFunctionParameters().AddStringArray(value))
  1665  	result, err := contractCal.Execute(env.Client)
  1666  	require.NoError(t, err)
  1667  	parsedResult, _ := result.GetResult("string[]")
  1668  	strArr := parsedResult.([]interface{})[0].([]string)
  1669  	require.Equal(t, value[0], strArr[0])
  1670  	require.Equal(t, value[1], strArr[1])
  1671  	err = CloseIntegrationTestEnv(env, nil)
  1672  	require.NoError(t, err)
  1673  }
  1674  func TestAddress(t *testing.T) {
  1675  
  1676  	env := NewIntegrationTestEnv(t)
  1677  	deployContract(env)
  1678  	value := "1234567890123456789012345678901234567890"
  1679  	params, err := NewContractFunctionParameters().AddAddress(value)
  1680  	require.NoError(t, err)
  1681  	contractCal := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1682  		SetContractID(contractID).SetFunction("returnAddress", params)
  1683  	result, err := contractCal.Execute(env.Client)
  1684  	require.NoError(t, err)
  1685  	require.Equal(t, value, hex.EncodeToString(result.GetAddress(0)))
  1686  	err = CloseIntegrationTestEnv(env, nil)
  1687  	require.NoError(t, err)
  1688  }
  1689  
  1690  func TestAddressArray(t *testing.T) {
  1691  
  1692  	env := NewIntegrationTestEnv(t)
  1693  	deployContract(env)
  1694  	value := []string{"1234567890123456789012345678901234567890", "1234567890123456789012345678901234567891"}
  1695  	params, err := NewContractFunctionParameters().AddAddressArray(value)
  1696  	require.NoError(t, err)
  1697  	contractCal := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1698  		SetContractID(contractID).SetFunction("returnAddressArr", params)
  1699  	result, err := contractCal.Execute(env.Client)
  1700  	require.NoError(t, err)
  1701  	addArr, err := result.GetResult("address[]")
  1702  	require.NoError(t, err)
  1703  	addresses := addArr.([]interface{})[0].([]common.Address)
  1704  	require.Equal(t, value[0], strings.TrimPrefix(addresses[0].String(), "0x"))
  1705  	require.Equal(t, value[1], strings.TrimPrefix(addresses[1].String(), "0x"))
  1706  	err = CloseIntegrationTestEnv(env, nil)
  1707  	require.NoError(t, err)
  1708  }
  1709  
  1710  func TestBoolean(t *testing.T) {
  1711  
  1712  	env := NewIntegrationTestEnv(t)
  1713  	deployContract(env)
  1714  	value := true
  1715  
  1716  	contractCal := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1717  		SetContractID(contractID).SetFunction("returnBoolean", NewContractFunctionParameters().AddBool(value))
  1718  	result, err := contractCal.Execute(env.Client)
  1719  	require.NoError(t, err)
  1720  	require.Equal(t, value, result.GetBool(0))
  1721  	err = CloseIntegrationTestEnv(env, nil)
  1722  	require.NoError(t, err)
  1723  }
  1724  
  1725  func TestBytes(t *testing.T) {
  1726  
  1727  	env := NewIntegrationTestEnv(t)
  1728  	deployContract(env)
  1729  	value := []byte("Test")
  1730  
  1731  	contractCal := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1732  		SetContractID(contractID).SetFunction("returnBytes", NewContractFunctionParameters().AddBytes(value))
  1733  	result, err := contractCal.Execute(env.Client)
  1734  	require.NoError(t, err)
  1735  	require.Equal(t, value, result.GetBytes(0))
  1736  	err = CloseIntegrationTestEnv(env, nil)
  1737  	require.NoError(t, err)
  1738  }
  1739  
  1740  func TestBytesArray(t *testing.T) {
  1741  
  1742  	env := NewIntegrationTestEnv(t)
  1743  	deployContract(env)
  1744  	value := [][]byte{[]byte("Test1"), []byte("Test2")}
  1745  
  1746  	contractCal := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1747  		SetContractID(contractID).SetFunction("returnBytesArr", NewContractFunctionParameters().AddBytesArray(value))
  1748  	result, err := contractCal.Execute(env.Client)
  1749  	require.NoError(t, err)
  1750  	bytesArrInterface, err := result.GetResult("bytes[]")
  1751  	require.NoError(t, err)
  1752  	require.Equal(t, value, bytesArrInterface.([]interface{})[0])
  1753  
  1754  	err = CloseIntegrationTestEnv(env, nil)
  1755  	require.NoError(t, err)
  1756  }
  1757  
  1758  func TestBytes32(t *testing.T) {
  1759  
  1760  	env := NewIntegrationTestEnv(t)
  1761  	deployContract(env)
  1762  	value := [32]byte{}
  1763  	copy(value[:], []byte("Test"))
  1764  
  1765  	contractCal := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).
  1766  		SetContractID(contractID).SetFunction("returnBytes32", NewContractFunctionParameters().AddBytes32(value))
  1767  	result, err := contractCal.Execute(env.Client)
  1768  	require.NoError(t, err)
  1769  	require.True(t, reflect.DeepEqual(value[:], result.GetBytes32(0)))
  1770  	err = CloseIntegrationTestEnv(env, nil)
  1771  	require.NoError(t, err)
  1772  }
  1773  
  1774  func TestBytes32Array(t *testing.T) {
  1775  
  1776  	env := NewIntegrationTestEnv(t)
  1777  	deployContract(env)
  1778  
  1779  	value := [][]byte{
  1780  		[]byte("Test1"),
  1781  		[]byte("Test2"),
  1782  	}
  1783  	var expected1 [32]byte
  1784  	var expected2 [32]byte
  1785  	copy(expected1[len(expected1)-len(value[0]):], value[0])
  1786  	copy(expected2[len(expected2)-len(value[1]):], value[1])
  1787  
  1788  	contractCal := NewContractCallQuery().SetGas(15000000).SetQueryPayment(NewHbar(12)).SetQueryPayment(NewHbar(11)).
  1789  		SetContractID(contractID).SetFunction("returnBytes32Arr", NewContractFunctionParameters().AddBytes32Array(value))
  1790  	result, err := contractCal.Execute(env.Client)
  1791  	require.NoError(t, err)
  1792  	bytes32ArrInterface, err := result.GetResult("bytes32[]")
  1793  	require.NoError(t, err)
  1794  	require.Equal(t, expected1, bytes32ArrInterface.([]interface{})[0].([][32]byte)[0])
  1795  	require.Equal(t, expected2, bytes32ArrInterface.([]interface{})[0].([][32]byte)[1])
  1796  	err = CloseIntegrationTestEnv(env, nil)
  1797  	require.NoError(t, err)
  1798  }
  1799  
  1800  func TestContractNonces(t *testing.T) {
  1801  
  1802  	env := NewIntegrationTestEnv(t)
  1803  	bytecode := []byte(`6080604052348015600f57600080fd5b50604051601a90603b565b604051809103906000f0801580156035573d6000803e3d6000fd5b50506047565b605c8061009483390190565b603f806100556000396000f3fe6080604052600080fdfea2646970667358221220a20122cbad3457fedcc0600363d6e895f17048f5caa4afdab9e655123737567d64736f6c634300081200336080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea264697066735822122053dfd8835e3dc6fedfb8b4806460b9b7163f8a7248bac510c6d6808d9da9d6d364736f6c63430008120033`)
  1804  	fileCreate, err := NewFileCreateTransaction().
  1805  		SetKeys(env.OperatorKey.PublicKey()).
  1806  		SetContents(bytecode).
  1807  		Execute(env.Client)
  1808  	require.NoError(t, err)
  1809  	fileCreate.SetValidateStatus(true)
  1810  	receipt, err := fileCreate.GetReceipt(env.Client)
  1811  	require.NoError(t, err)
  1812  	require.Equal(t, StatusSuccess, receipt.Status)
  1813  	contractCreate, err := NewContractCreateTransaction().
  1814  		SetAdminKey(env.OperatorKey).
  1815  		SetGas(100000).
  1816  		SetBytecodeFileID(*receipt.FileID).
  1817  		SetContractMemo("[e2e::ContractADeploysContractBInConstructor]").
  1818  		Execute(env.Client)
  1819  	require.NoError(t, err)
  1820  	contractCreate.SetValidateStatus(true)
  1821  	record, err := contractCreate.GetRecord(env.Client)
  1822  	require.NoError(t, err)
  1823  	require.Equal(t, StatusSuccess, record.Receipt.Status)
  1824  	require.Equal(t, int64(2), record.CallResult.ContractNonces[0].Nonce)
  1825  	require.Equal(t, int64(1), record.CallResult.ContractNonces[1].Nonce)
  1826  }