Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
张蕾
Geth-Modification
Commits
4097ba6a
Commit
4097ba6a
authored
Feb 07, 2019
by
Derek Gottfrid
Committed by
Péter Szilágyi
Feb 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mobile: add ability to create transactions for deploying contracts (#16104)
parent
26aea736
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
types.go
mobile/types.go
+11
-1
No files found.
mobile/types.go
View file @
4097ba6a
...
...
@@ -197,8 +197,18 @@ type Transaction struct {
tx
*
types
.
Transaction
}
// NewTransaction creates a new transaction with the given properties.
// NewContractCreation creates a new transaction for deploying a new contract with
// the given properties.
func
NewContractCreation
(
nonce
int64
,
amount
*
BigInt
,
gasLimit
int64
,
gasPrice
*
BigInt
,
data
[]
byte
)
*
Transaction
{
return
&
Transaction
{
types
.
NewContractCreation
(
uint64
(
nonce
),
amount
.
bigint
,
uint64
(
gasLimit
),
gasPrice
.
bigint
,
common
.
CopyBytes
(
data
))}
}
// NewTransaction creates a new transaction with the given properties. Contracts
// can be created by transacting with a nil recipient.
func
NewTransaction
(
nonce
int64
,
to
*
Address
,
amount
*
BigInt
,
gasLimit
int64
,
gasPrice
*
BigInt
,
data
[]
byte
)
*
Transaction
{
if
to
==
nil
{
return
&
Transaction
{
types
.
NewContractCreation
(
uint64
(
nonce
),
amount
.
bigint
,
uint64
(
gasLimit
),
gasPrice
.
bigint
,
common
.
CopyBytes
(
data
))}
}
return
&
Transaction
{
types
.
NewTransaction
(
uint64
(
nonce
),
to
.
address
,
amount
.
bigint
,
uint64
(
gasLimit
),
gasPrice
.
bigint
,
common
.
CopyBytes
(
data
))}
}
...
...
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