mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-05 03:06:16 +00:00
core: fix SystemFee calculation for Invocation TXes
They have it specified right in the transaction. Unfortunately, this little change rendered invalid our RPC test chain, but I think it became even better after it, especially given that chain generation is a nice test by itself, so it should be running as a regular test.
This commit is contained in:
parent
ae6edf0601
commit
81d89cd502
4 changed files with 172 additions and 94 deletions
|
@ -1209,6 +1209,12 @@ func (bc *Blockchain) NetworkFee(t *transaction.Transaction) util.Fixed8 {
|
|||
|
||||
// SystemFee returns system fee.
|
||||
func (bc *Blockchain) SystemFee(t *transaction.Transaction) util.Fixed8 {
|
||||
if t.Type == transaction.InvocationType {
|
||||
inv := t.Data.(*transaction.InvocationTX)
|
||||
if inv.Version >= 1 {
|
||||
return inv.Gas
|
||||
}
|
||||
}
|
||||
return bc.GetConfig().SystemFee.TryGetValue(t.Type)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue