-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6221 from multiversx/update-feat-chain-simulator-…
…30.05 Update feat chain simulator 30.05
- Loading branch information
Showing
13 changed files
with
525 additions
and
474 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package chainSimulator | ||
|
||
import ( | ||
"math/big" | ||
|
||
"github.com/multiversx/mx-chain-go/node/chainSimulator/configs" | ||
|
||
"github.com/multiversx/mx-chain-core-go/data/transaction" | ||
) | ||
|
||
const ( | ||
minGasPrice = 1000000000 | ||
txVersion = 1 | ||
mockTxSignature = "sig" | ||
|
||
// OkReturnCode the const for the ok return code | ||
OkReturnCode = "ok" | ||
) | ||
|
||
var ( | ||
// ZeroValue the variable for the zero big int | ||
ZeroValue = big.NewInt(0) | ||
// OneEGLD the variable for one egld value | ||
OneEGLD = big.NewInt(1000000000000000000) | ||
// MinimumStakeValue the variable for the minimum stake value | ||
MinimumStakeValue = big.NewInt(0).Mul(OneEGLD, big.NewInt(2500)) | ||
// InitialAmount the variable for initial minting amount in account | ||
InitialAmount = big.NewInt(0).Mul(OneEGLD, big.NewInt(100)) | ||
) | ||
|
||
// GenerateTransaction will generate a transaction based on input data | ||
func GenerateTransaction(sender []byte, nonce uint64, receiver []byte, value *big.Int, data string, gasLimit uint64) *transaction.Transaction { | ||
return &transaction.Transaction{ | ||
Nonce: nonce, | ||
Value: value, | ||
SndAddr: sender, | ||
RcvAddr: receiver, | ||
Data: []byte(data), | ||
GasLimit: gasLimit, | ||
GasPrice: minGasPrice, | ||
ChainID: []byte(configs.ChainID), | ||
Version: txVersion, | ||
Signature: []byte(mockTxSignature), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.