Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
contract-case
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanjinfei
contract-case
Commits
7d098078
Commit
7d098078
authored
May 16, 2023
by
duanjinfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change init account problem
parent
6fd5ed47
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
+17
-13
app.json
config/app.json
+7
-7
operator.go
operator/operator.go
+10
-6
No files found.
config/app.json
View file @
7d098078
...
...
@@ -10,15 +10,15 @@
"goRoutine"
:
1
,
"generateAccCount"
:
500
,
"isDeployContract"
:
false
,
"isInitAccountBalance"
:
fals
e
,
"isInitAccCoin"
:
tru
e
,
"isInitContractCoin"
:
tru
e
,
"isInitErc20"
:
tru
e
,
"isInitErc721Mint"
:
tru
e
,
"isInitErc721"
:
true
,
"isInitAccountBalance"
:
tru
e
,
"isInitAccCoin"
:
fals
e
,
"isInitContractCoin"
:
fals
e
,
"isInitErc20"
:
fals
e
,
"isInitErc721Mint"
:
fals
e
,
"isInitErc721"
:
false
,
"startTokenId"
:
1
,
"endTokenId"
:
100
,
"transferType"
:
[
1
,
2
,
3
,
4
,
5
,
6
,
7
]
"transferType"
:
[]
}
...
...
operator/operator.go
View file @
7d098078
...
...
@@ -295,29 +295,33 @@ func InitCaseAccount(client *ethclient.Client, txArr []*types.Transaction) []*ty
}
contractMap
:=
tool
.
ParseContractConfig
(
"./config/contractConfig.json"
)
contractLen
:=
len
(
contractMap
)
tempTxArr
:=
make
([]
*
types
.
Transaction
,
0
)
//初始化From账户-500tx
if
tool
.
Cfg
.
IsInitAccCoin
{
tempTxArr
,
nonce
=
InitAccountCoin
(
txArr
,
nonce
,
amount
,
accArr
)
tempTxArr
:=
make
([]
*
types
.
Transaction
,
0
)
tempTxArr
,
nonce
=
InitAccountCoin
(
tempTxArr
,
nonce
,
amount
,
accArr
)
txArr
=
append
(
txArr
,
tempTxArr
...
)
}
//初始化转账合约账户余额-10tx
if
tool
.
Cfg
.
IsInitContractCoin
{
tempTxArr
,
nonce
=
InitContractCoin
(
txArr
,
nonce
,
contractLen
,
contractMap
,
trade
)
tempTxArr
:=
make
([]
*
types
.
Transaction
,
0
)
tempTxArr
,
nonce
=
InitContractCoin
(
tempTxArr
,
nonce
,
contractLen
,
contractMap
,
trade
)
txArr
=
append
(
txArr
,
tempTxArr
...
)
}
// 初始化erc20 并且mint
if
tool
.
Cfg
.
IsInitErc20
{
tempTxArr
,
nonce
=
InitErc20Acc
(
txArr
,
nonce
,
contractLen
,
contractMap
,
accArr
,
client
,
auth
)
tempTxArr
:=
make
([]
*
types
.
Transaction
,
0
)
tempTxArr
,
nonce
=
InitErc20Acc
(
tempTxArr
,
nonce
,
contractLen
,
contractMap
,
accArr
,
client
,
auth
)
txArr
=
append
(
txArr
,
tempTxArr
...
)
}
//初始化erc721 并且mint
if
tool
.
Cfg
.
IsInitErc721Mint
{
tempTxArr
,
nonce
=
InitErc721AccMint
(
txArr
,
nonce
,
contractLen
,
contractMap
,
accArr
,
client
,
auth
)
tempTxArr
:=
make
([]
*
types
.
Transaction
,
0
)
tempTxArr
,
nonce
=
InitErc721AccMint
(
tempTxArr
,
nonce
,
contractLen
,
contractMap
,
accArr
,
client
,
auth
)
txArr
=
append
(
txArr
,
tempTxArr
...
)
}
if
tool
.
Cfg
.
IsInitErc721
{
tempTxArr
,
nonce
=
InitErc721AccTransfer
(
txArr
,
nonce
,
contractLen
,
contractMap
,
accArr
,
client
,
auth
)
tempTxArr
:=
make
([]
*
types
.
Transaction
,
0
)
tempTxArr
,
nonce
=
InitErc721AccTransfer
(
tempTxArr
,
nonce
,
contractLen
,
contractMap
,
accArr
,
client
,
auth
)
txArr
=
append
(
txArr
,
tempTxArr
...
)
}
log
.
Info
(
"Init balance successful,wait send tran..........."
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment