add gas numbers for v2
This commit is contained in:
parent
1a7fb06dd9
commit
52e064dabb
@ -10,7 +10,9 @@ import (
|
|||||||
|
|
||||||
"github.com/filecoin-project/go-address"
|
"github.com/filecoin-project/go-address"
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
"github.com/filecoin-project/specs-actors/actors/builtin"
|
|
||||||
|
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||||
|
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ActorLookup func(context.Context, address.Address, types.TipSetKey) (*types.Actor, error)
|
type ActorLookup func(context.Context, address.Address, types.TipSetKey) (*types.Actor, error)
|
||||||
@ -27,19 +29,32 @@ type CostKey struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var Costs = map[CostKey]int64{
|
var Costs = map[CostKey]int64{
|
||||||
{builtin.InitActorCodeID, 2}: 8916753,
|
{builtin0.InitActorCodeID, 2}: 8916753,
|
||||||
{builtin.StorageMarketActorCodeID, 2}: 6955002,
|
{builtin0.StorageMarketActorCodeID, 2}: 6955002,
|
||||||
{builtin.StorageMarketActorCodeID, 4}: 245436108,
|
{builtin0.StorageMarketActorCodeID, 4}: 245436108,
|
||||||
{builtin.StorageMinerActorCodeID, 4}: 2315133,
|
{builtin0.StorageMinerActorCodeID, 4}: 2315133,
|
||||||
{builtin.StorageMinerActorCodeID, 5}: 1600271356,
|
{builtin0.StorageMinerActorCodeID, 5}: 1600271356,
|
||||||
{builtin.StorageMinerActorCodeID, 6}: 22864493,
|
{builtin0.StorageMinerActorCodeID, 6}: 22864493,
|
||||||
{builtin.StorageMinerActorCodeID, 7}: 142002419,
|
{builtin0.StorageMinerActorCodeID, 7}: 142002419,
|
||||||
{builtin.StorageMinerActorCodeID, 10}: 23008274,
|
{builtin0.StorageMinerActorCodeID, 10}: 23008274,
|
||||||
{builtin.StorageMinerActorCodeID, 11}: 19303178,
|
{builtin0.StorageMinerActorCodeID, 11}: 19303178,
|
||||||
{builtin.StorageMinerActorCodeID, 14}: 566356835,
|
{builtin0.StorageMinerActorCodeID, 14}: 566356835,
|
||||||
{builtin.StorageMinerActorCodeID, 16}: 5325185,
|
{builtin0.StorageMinerActorCodeID, 16}: 5325185,
|
||||||
{builtin.StorageMinerActorCodeID, 18}: 2328637,
|
{builtin0.StorageMinerActorCodeID, 18}: 2328637,
|
||||||
{builtin.StoragePowerActorCodeID, 2}: 23600956,
|
{builtin0.StoragePowerActorCodeID, 2}: 23600956,
|
||||||
|
{builtin2.InitActorCodeID, 2}: 8916753,
|
||||||
|
{builtin2.StorageMarketActorCodeID, 2}: 6955002,
|
||||||
|
{builtin2.StorageMarketActorCodeID, 4}: 245436108,
|
||||||
|
{builtin2.StorageMinerActorCodeID, 4}: 2315133,
|
||||||
|
{builtin2.StorageMinerActorCodeID, 5}: 1600271356,
|
||||||
|
{builtin2.StorageMinerActorCodeID, 6}: 22864493,
|
||||||
|
{builtin2.StorageMinerActorCodeID, 7}: 142002419,
|
||||||
|
{builtin2.StorageMinerActorCodeID, 10}: 23008274,
|
||||||
|
{builtin2.StorageMinerActorCodeID, 11}: 19303178,
|
||||||
|
{builtin2.StorageMinerActorCodeID, 14}: 566356835,
|
||||||
|
{builtin2.StorageMinerActorCodeID, 16}: 5325185,
|
||||||
|
{builtin2.StorageMinerActorCodeID, 18}: 2328637,
|
||||||
|
{builtin2.StoragePowerActorCodeID, 2}: 23600956,
|
||||||
}
|
}
|
||||||
|
|
||||||
func failedGuess(msg *types.SignedMessage) int64 {
|
func failedGuess(msg *types.SignedMessage) int64 {
|
||||||
@ -51,7 +66,8 @@ func failedGuess(msg *types.SignedMessage) int64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GuessGasUsed(ctx context.Context, tsk types.TipSetKey, msg *types.SignedMessage, al ActorLookup) (int64, error) {
|
func GuessGasUsed(ctx context.Context, tsk types.TipSetKey, msg *types.SignedMessage, al ActorLookup) (int64, error) {
|
||||||
if msg.Message.Method == builtin.MethodSend {
|
// MethodSend is the same in all versions.
|
||||||
|
if msg.Message.Method == builtin0.MethodSend {
|
||||||
switch msg.Message.From.Protocol() {
|
switch msg.Message.From.Protocol() {
|
||||||
case address.BLS:
|
case address.BLS:
|
||||||
return 1298450, nil
|
return 1298450, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user