good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
2c90c0df
Commit
2c90c0df
authored
Jan 3, 2014
by
Jeffrey Wilcke
Browse files
Options
Downloads
Patches
Plain Diff
Updated fee
parent
2d3c3674
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
transaction.go
+10
-7
10 additions, 7 deletions
transaction.go
with
10 additions
and
7 deletions
transaction.go
+
10
−
7
View file @
2c90c0df
...
@@ -34,9 +34,10 @@ var Period3Reward *big.Int = new(big.Int)
...
@@ -34,9 +34,10 @@ var Period3Reward *big.Int = new(big.Int)
var
Period4Reward
*
big
.
Int
=
new
(
big
.
Int
)
var
Period4Reward
*
big
.
Int
=
new
(
big
.
Int
)
type
Transaction
struct
{
type
Transaction
struct
{
nonce
string
sender
string
sender
string
recipient
string
recipient
string
value
uint
32
value
uint
64
fee
uint32
fee
uint32
data
[]
string
data
[]
string
memory
[]
int
memory
[]
int
...
@@ -47,8 +48,9 @@ type Transaction struct {
...
@@ -47,8 +48,9 @@ type Transaction struct {
addr
string
addr
string
}
}
func
NewTransaction
(
to
string
,
value
uint
32
,
data
[]
string
)
*
Transaction
{
func
NewTransaction
(
to
string
,
value
uint
64
,
data
[]
string
)
*
Transaction
{
tx
:=
Transaction
{
sender
:
"1234567890"
,
recipient
:
to
,
value
:
value
}
tx
:=
Transaction
{
sender
:
"1234567890"
,
recipient
:
to
,
value
:
value
}
tx
.
nonce
=
"0"
tx
.
fee
=
0
//uint32((ContractFee + MemoryFee * float32(len(tx.data))) * 1e8)
tx
.
fee
=
0
//uint32((ContractFee + MemoryFee * float32(len(tx.data))) * 1e8)
tx
.
lastTx
=
"0"
tx
.
lastTx
=
"0"
...
@@ -102,16 +104,16 @@ func (tx *Transaction) UnmarshalRlp(data []byte) {
...
@@ -102,16 +104,16 @@ func (tx *Transaction) UnmarshalRlp(data []byte) {
// If only I knew of a better way.
// If only I knew of a better way.
if
value
,
ok
:=
slice
[
3
]
.
(
uint8
);
ok
{
if
value
,
ok
:=
slice
[
3
]
.
(
uint8
);
ok
{
tx
.
value
=
uint
32
(
value
)
tx
.
value
=
uint
64
(
value
)
}
}
if
value
,
ok
:=
slice
[
3
]
.
(
uint16
);
ok
{
if
value
,
ok
:=
slice
[
3
]
.
(
uint16
);
ok
{
tx
.
value
=
uint
32
(
value
)
tx
.
value
=
uint
64
(
value
)
}
}
if
value
,
ok
:=
slice
[
3
]
.
(
uint32
);
ok
{
if
value
,
ok
:=
slice
[
3
]
.
(
uint32
);
ok
{
tx
.
value
=
uint
32
(
value
)
tx
.
value
=
uint
64
(
value
)
}
}
if
value
,
ok
:=
slice
[
3
]
.
(
uint64
);
ok
{
if
value
,
ok
:=
slice
[
3
]
.
(
uint64
);
ok
{
tx
.
value
=
uint
32
(
value
)
tx
.
value
=
uint
64
(
value
)
}
}
if
fee
,
ok
:=
slice
[
4
]
.
(
uint8
);
ok
{
if
fee
,
ok
:=
slice
[
4
]
.
(
uint8
);
ok
{
tx
.
fee
=
uint32
(
fee
)
tx
.
fee
=
uint32
(
fee
)
...
@@ -146,7 +148,8 @@ func InitFees() {
...
@@ -146,7 +148,8 @@ func InitFees() {
b80
:=
new
(
big
.
Int
)
b80
:=
new
(
big
.
Int
)
b80
.
Exp
(
big
.
NewInt
(
2
),
big
.
NewInt
(
80
),
big
.
NewInt
(
0
))
b80
.
Exp
(
big
.
NewInt
(
2
),
big
.
NewInt
(
80
),
big
.
NewInt
(
0
))
StepFee
.
Div
(
b60
,
big
.
NewInt
(
64
))
StepFee
.
Exp
(
big
.
NewInt
(
10
),
big
.
NewInt
(
16
),
big
.
NewInt
(
0
))
//StepFee.Div(b60, big.NewInt(64))
//fmt.Println("StepFee:", StepFee)
//fmt.Println("StepFee:", StepFee)
TxFee
.
Exp
(
big
.
NewInt
(
2
),
big
.
NewInt
(
64
),
big
.
NewInt
(
0
))
TxFee
.
Exp
(
big
.
NewInt
(
2
),
big
.
NewInt
(
64
),
big
.
NewInt
(
0
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment