@@ -10,6 +10,7 @@ import (
1010 "testing"
1111 "time"
1212
13+ cryptoPaymentsFramework "github.com/iulianpascalau/mx-crypto-payments/integrationTests/framework"
1314 "github.com/multiversx/mx-chain-core-go/core"
1415 "github.com/multiversx/mx-chain-core-go/core/pubkeyConverter"
1516 apiCore "github.com/multiversx/mx-chain-core-go/data/api"
@@ -44,9 +45,10 @@ const (
4445)
4546
4647var (
47- log = logger .GetOrCreate ("integrationTests" )
48- signer = & singlesig.Ed25519Signer {}
49- keyGenerator = signing .NewKeyGenerator (ed25519 .NewEd25519 ())
48+ log = logger .GetOrCreate ("integrationTests" )
49+ signer = & singlesig.Ed25519Signer {}
50+ keyGenerator = signing .NewKeyGenerator (ed25519 .NewEd25519 ())
51+ addressPubkeyConverter , _ = pubkeyConverter .NewBech32PubkeyConverter (32 , "erd" )
5052)
5153
5254// ESDTSupply represents the DTO that holds the supply values for a token
@@ -132,7 +134,7 @@ func (instance *chainSimulatorWrapper) GetNetworkAddress() string {
132134}
133135
134136// DeploySC will deploy the provided smart contract and return its address
135- func (instance * chainSimulatorWrapper ) DeploySC (ctx context.Context , wasmFilePath string , ownerSK []byte , gasLimit uint64 , parameters []string ) (* MvxAddress , string , * data.TransactionOnNetwork ) {
137+ func (instance * chainSimulatorWrapper ) DeploySC (ctx context.Context , wasmFilePath string , ownerSK []byte , gasLimit uint64 , parameters []string ) (* cryptoPaymentsFramework. MvxAddress , string , * data.TransactionOnNetwork ) {
136138 networkConfig , err := instance .proxyInstance .GetNetworkConfig (ctx )
137139 require .Nil (instance .TB , err )
138140
@@ -164,11 +166,11 @@ func (instance *chainSimulatorWrapper) DeploySC(ctx context.Context, wasmFilePat
164166 require .Nil (instance , err )
165167 require .Equal (instance , transaction .TxStatusSuccess , txStatus , fmt .Sprintf ("tx hash: %s,\n tx: %s" , hash , string (jsonData )))
166168
167- return NewMvxAddressFromBech32 (instance .TB , txResult .Logs .Events [0 ].Address ), hash , txResult
169+ return cryptoPaymentsFramework . NewMvxAddressFromBech32 (instance .TB , txResult .Logs .Events [0 ].Address ), hash , txResult
168170}
169171
170172// UpgradeSC will upgrade the provided smart contract
171- func (instance * chainSimulatorWrapper ) UpgradeSC (ctx context.Context , scAddress * MvxAddress , wasmFilePath string , ownerSK []byte , gasLimit uint64 , parameters []string ) (string , * data.TransactionOnNetwork ) {
173+ func (instance * chainSimulatorWrapper ) UpgradeSC (ctx context.Context , scAddress * cryptoPaymentsFramework. MvxAddress , wasmFilePath string , ownerSK []byte , gasLimit uint64 , parameters []string ) (string , * data.TransactionOnNetwork ) {
172174 networkConfig , err := instance .proxyInstance .GetNetworkConfig (ctx )
173175 require .Nil (instance .TB , err )
174176
@@ -253,12 +255,12 @@ func (instance *chainSimulatorWrapper) GenerateBlocksUntilTxProcessed(ctx contex
253255}
254256
255257// ScCall will make the provided sc call
256- func (instance * chainSimulatorWrapper ) ScCall (ctx context.Context , senderSK []byte , contract * MvxAddress , value string , gasLimit uint64 , function string , parameters []string ) (string , * data.TransactionOnNetwork , transaction.TxStatus ) {
258+ func (instance * chainSimulatorWrapper ) ScCall (ctx context.Context , senderSK []byte , contract * cryptoPaymentsFramework. MvxAddress , value string , gasLimit uint64 , function string , parameters []string ) (string , * data.TransactionOnNetwork , transaction.TxStatus ) {
257259 return instance .SendTx (ctx , senderSK , contract , value , gasLimit , createTxData (function , parameters ))
258260}
259261
260262// ScCallWithoutGenerateBlocks will make the provided sc call and do not trigger the generate blocks command
261- func (instance * chainSimulatorWrapper ) ScCallWithoutGenerateBlocks (ctx context.Context , senderSK []byte , contract * MvxAddress , value string , gasLimit uint64 , function string , parameters []string ) string {
263+ func (instance * chainSimulatorWrapper ) ScCallWithoutGenerateBlocks (ctx context.Context , senderSK []byte , contract * cryptoPaymentsFramework. MvxAddress , value string , gasLimit uint64 , function string , parameters []string ) string {
262264 return instance .SendTxWithoutGenerateBlocks (ctx , senderSK , contract , value , gasLimit , createTxData (function , parameters ))
263265}
264266
@@ -271,7 +273,7 @@ func createTxData(function string, parameters []string) []byte {
271273}
272274
273275// SendTx will build and send a transaction
274- func (instance * chainSimulatorWrapper ) SendTx (ctx context.Context , senderSK []byte , receiver * MvxAddress , value string , gasLimit uint64 , dataField []byte ) (string , * data.TransactionOnNetwork , transaction.TxStatus ) {
276+ func (instance * chainSimulatorWrapper ) SendTx (ctx context.Context , senderSK []byte , receiver * cryptoPaymentsFramework. MvxAddress , value string , gasLimit uint64 , dataField []byte ) (string , * data.TransactionOnNetwork , transaction.TxStatus ) {
275277 hash := instance .SendTxWithoutGenerateBlocks (ctx , senderSK , receiver , value , gasLimit , dataField )
276278 instance .GenerateBlocks (ctx , 1 )
277279 txResult , txStatus := instance .GetTransactionResult (ctx , hash )
@@ -280,7 +282,7 @@ func (instance *chainSimulatorWrapper) SendTx(ctx context.Context, senderSK []by
280282}
281283
282284// SendTxWithoutGenerateBlocks will build and send a transaction without generating blocks
283- func (instance * chainSimulatorWrapper ) SendTxWithoutGenerateBlocks (ctx context.Context , senderSK []byte , receiver * MvxAddress , value string , gasLimit uint64 , dataField []byte ) string {
285+ func (instance * chainSimulatorWrapper ) SendTxWithoutGenerateBlocks (ctx context.Context , senderSK []byte , receiver * cryptoPaymentsFramework. MvxAddress , value string , gasLimit uint64 , dataField []byte ) string {
284286 senderPK := instance .getPublicKey (senderSK )
285287 nonce , err := instance .getNonce (ctx , senderPK )
286288 require .Nil (instance , err )
@@ -289,7 +291,7 @@ func (instance *chainSimulatorWrapper) SendTxWithoutGenerateBlocks(ctx context.C
289291}
290292
291293// SendTxWithNonceWithoutGenerateBlocks will build a transaction with given nonce and send it without generating blocks
292- func (instance * chainSimulatorWrapper ) SendTxWithNonceWithoutGenerateBlocks (ctx context.Context , senderSK []byte , receiver * MvxAddress , nonce uint64 , value string , gasLimit uint64 , dataField []byte ) string {
294+ func (instance * chainSimulatorWrapper ) SendTxWithNonceWithoutGenerateBlocks (ctx context.Context , senderSK []byte , receiver * cryptoPaymentsFramework. MvxAddress , nonce uint64 , value string , gasLimit uint64 , dataField []byte ) string {
293295 networkConfig , err := instance .proxyInstance .GetNetworkConfig (ctx )
294296 require .Nil (instance , err )
295297
@@ -337,7 +339,7 @@ func (instance *chainSimulatorWrapper) FundWallets(ctx context.Context, wallets
337339}
338340
339341// GetESDTBalance returns the balance of the esdt token for the provided address
340- func (instance * chainSimulatorWrapper ) GetESDTBalance (ctx context.Context , address * MvxAddress , token string ) string {
342+ func (instance * chainSimulatorWrapper ) GetESDTBalance (ctx context.Context , address * cryptoPaymentsFramework. MvxAddress , token string ) string {
341343 tokenData , err := instance .proxyInstance .GetESDTTokenData (ctx , address , token , apiCore.AccountQueryOptions {
342344 OnFinalBlock : true ,
343345 })
@@ -426,7 +428,7 @@ func computeTransactionSignature(senderSk []byte, tx *transaction.FrontendTransa
426428// ExecuteVMQuery will try to execute a VM query and return the results
427429func (instance * chainSimulatorWrapper ) ExecuteVMQuery (
428430 ctx context.Context ,
429- scAddress * MvxAddress ,
431+ scAddress * cryptoPaymentsFramework. MvxAddress ,
430432 function string ,
431433 hexParams []string ,
432434) [][]byte {
0 commit comments