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
9cf8ce9e
Commit
9cf8ce9e
authored
Mar 20, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New tx methods and added new vm to state manager
parent
f567f89b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
15 deletions
+22
-15
state_manager.go
ethchain/state_manager.go
+7
-9
transaction.go
ethchain/transaction.go
+15
-6
No files found.
ethchain/state_manager.go
View file @
9cf8ce9e
...
...
@@ -305,19 +305,17 @@ func (sm *StateManager) ProcessContract(contract *Contract, tx *Transaction, blo
}
}()
*/
/*TODO to be fixed and replaced by the new vm
vm := &Vm{}
vm.Process(contract, sm.procState, RuntimeVars{
address: tx.Hash()[12:],
caller
:=
sm
.
procState
.
GetAccount
(
tx
.
Sender
())
closure
:=
NewClosure
(
caller
,
contract
,
sm
.
procState
,
tx
.
Gas
,
tx
.
Value
)
vm
:=
NewVm
(
sm
.
procState
,
RuntimeVars
{
origin
:
caller
.
Address
,
blockNumber
:
block
.
BlockInfo
()
.
Number
,
sender: tx.Sender(),
prevHash
:
block
.
PrevHash
,
coinbase
:
block
.
Coinbase
,
time
:
block
.
Time
,
diff
:
block
.
Difficulty
,
txValue: tx.Value,
txData:
tx.Data
,
// XXX Tx data? Could be just an argument to the closure instead
txData
:
nil
,
})
*/
closure
.
Call
(
vm
,
nil
)
}
ethchain/transaction.go
View file @
9cf8ce9e
...
...
@@ -13,22 +13,31 @@ type Transaction struct {
Nonce
uint64
Recipient
[]
byte
Value
*
big
.
Int
Gas
*
big
.
Int
Gasprice
*
big
.
Int
Data
[]
string
Memory
[]
int
v
byte
r
,
s
[]
byte
}
func
NewTransaction
(
to
[]
byte
,
value
*
big
.
Int
,
data
[]
string
)
*
Transaction
{
tx
:=
Transaction
{
Recipient
:
to
,
Value
:
value
}
tx
.
Nonce
=
0
// Serialize the data
tx
.
Data
=
data
tx
:=
Transaction
{
Recipient
:
to
,
Value
:
value
,
Nonce
:
0
,
Data
:
data
}
return
&
tx
}
func
NewContractCreationTx
(
value
,
gasprice
*
big
.
Int
,
data
[]
string
)
*
Transaction
{
return
&
Transaction
{
Value
:
value
,
Gasprice
:
gasprice
,
Data
:
data
}
}
func
NewContractMessageTx
(
to
[]
byte
,
value
,
gasprice
,
gas
*
big
.
Int
,
data
[]
string
)
*
Transaction
{
return
&
Transaction
{
Recipient
:
to
,
Value
:
value
,
Gasprice
:
gasprice
,
Gas
:
gas
,
Data
:
data
}
}
func
NewTx
(
to
[]
byte
,
value
*
big
.
Int
,
data
[]
string
)
*
Transaction
{
return
&
Transaction
{
Recipient
:
to
,
Value
:
value
,
Gasprice
:
big
.
NewInt
(
0
),
Gas
:
big
.
NewInt
(
0
),
Nonce
:
0
,
Data
:
data
}
}
// XXX Deprecated
func
NewTransactionFromData
(
data
[]
byte
)
*
Transaction
{
return
NewTransactionFromBytes
(
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