OSDN Git Service
(root)
/
bytom
/
bytom.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8b0c70a
)
modify estimate-transaction-gas display
author
oysheng
<oysheng@bytom.io>
Fri, 20 Apr 2018 05:48:09 +0000
(13:48 +0800)
committer
oysheng
<oysheng@bytom.io>
Fri, 20 Apr 2018 05:48:09 +0000
(13:48 +0800)
api/transact.go
patch
|
blob
|
history
consensus/general.go
patch
|
blob
|
history
diff --git
a/api/transact.go
b/api/transact.go
index
abe16c0
..
57fd6a8
100644
(file)
--- a/
api/transact.go
+++ b/
api/transact.go
@@
-173,9
+173,9
@@
func (a *API) submit(ctx context.Context, ins struct {
// EstimateTxGasResp estimate transaction consumed gas
type EstimateTxGasResp struct {
// EstimateTxGasResp estimate transaction consumed gas
type EstimateTxGasResp struct {
- Total
Gas int64 `json:"total_gas
"`
- Storage
Gas int64 `json:"storage_gas
"`
- VM
Gas int64 `json:"vm_gas
"`
+ Total
Neu float64 `json:"total_neu
"`
+ Storage
Neu float64 `json:"storage_neu
"`
+ VM
Neu float64 `json:"vm_neu
"`
}
// POST /estimate-transaction-gas
}
// POST /estimate-transaction-gas
@@
-228,9
+228,9
@@
func (a *API) estimateTxGas(ctx context.Context, in struct {
totalGas := totalTxSizeGas + totalP2WPKHGas + totalP2WSHGas
txGasResp := &EstimateTxGasResp{
totalGas := totalTxSizeGas + totalP2WPKHGas + totalP2WSHGas
txGasResp := &EstimateTxGasResp{
- Total
Gas: totalGas
,
- Storage
Gas: totalTxSizeGas
,
- VM
Gas: totalP2WPKHGas + totalP2WSHGas
,
+ Total
Neu: float64(totalGas) / consensus.NeuBtmRate
,
+ Storage
Neu: float64(totalTxSizeGas) / consensus.NeuBtmRate
,
+ VM
Neu: float64(totalP2WPKHGas+totalP2WSHGas) / consensus.NeuBtmRate
,
}
return NewSuccessResponse(txGasResp)
}
return NewSuccessResponse(txGasResp)
diff --git
a/consensus/general.go
b/consensus/general.go
index
f8ea21c
..
41729cd
100644
(file)
--- a/
consensus/general.go
+++ b/
consensus/general.go
@@
-36,6
+36,7
@@
const (
StorageGasRate = int64(5)
MaxGasAmount = int64(100000)
DefaultGasCredit = int64(80000)
StorageGasRate = int64(5)
MaxGasAmount = int64(100000)
DefaultGasCredit = int64(80000)
+ NeuBtmRate = float64(100000)
BTMAlias = "BTM"
BTMSymbol = "BTM"
BTMAlias = "BTM"
BTMSymbol = "BTM"