Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[workaround] Merge #676 (gas accounting) with correct branch #685

Merged
merged 1 commit into from
Dec 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/systems/filecoin_markets/deal/deal.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ package deal
import actor "github.com/filecoin-project/specs/systems/filecoin_vm/actor"
import block "github.com/filecoin-project/specs/systems/filecoin_blockchain/struct/block"

const MIN_PROVIDER_DEAL_COLLATERAL_PER_EPOCH = actor.TokenAmount(1) // TODO: Placeholder
const MIN_CLIENT_DEAL_COLLATERAL_PER_EPOCH = actor.TokenAmount(1) // TODO: Placeholder
const MIN_DEAL_DURATION = block.ChainEpoch(0) // TODO: Placeholder
const MIN_DEAL_PRICE = actor.TokenAmount(0) // TODO: Placeholder
import util "github.com/filecoin-project/specs/util"

var IMPL_FINISH = util.IMPL_FINISH

var MIN_PROVIDER_DEAL_COLLATERAL_PER_EPOCH = actor.TokenAmount_Placeholder()
var MIN_CLIENT_DEAL_COLLATERAL_PER_EPOCH = actor.TokenAmount_Placeholder()
var MIN_DEAL_DURATION = block.ChainEpoch(0) // TODO: Placeholder
var MIN_DEAL_PRICE = actor.TokenAmount_Placeholder()

func (d *StorageDeal_I) Proposal() StorageDealProposal {
// extract from d.ProposalMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,25 @@ import (
deal "github.com/filecoin-project/specs/systems/filecoin_markets/deal"
sector "github.com/filecoin-project/specs/systems/filecoin_mining/sector"
actor "github.com/filecoin-project/specs/systems/filecoin_vm/actor"
addr "github.com/filecoin-project/specs/systems/filecoin_vm/actor/address"
st "github.com/filecoin-project/specs/systems/filecoin_vm/state_tree"
util "github.com/filecoin-project/specs/util"
)

var Assert = util.Assert

// Get the owner account address associated to a given miner actor.
func GetMinerOwnerAddress(tree st.StateTree, minerAddr addr.Address) (addr.Address, error) {
panic("TODO")
}

// Get the owner account address associated to a given miner actor.
func GetMinerOwnerAddress_Assert(tree st.StateTree, a addr.Address) addr.Address {
ret, err := GetMinerOwnerAddress(tree, a)
Assert(err == nil)
return ret
}

func (st *StorageMinerActorState_I) _isChallenged() bool {
return st.ChallengeStatus().IsChallenged()
}
Expand Down
7 changes: 7 additions & 0 deletions src/systems/filecoin_vm/actor/actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import filcrypto "github.com/filecoin-project/specs/algorithms/crypto"
import ipld "github.com/filecoin-project/specs/libraries/ipld"
import util "github.com/filecoin-project/specs/util"

var TODO = util.TODO

type Serialization = util.Serialization

const (
Expand Down Expand Up @@ -67,6 +69,11 @@ func (x ActorSubstateCID) Ref() *ActorSubstateCID {
return &x
}

func TokenAmount_Placeholder() TokenAmount {
TODO()
panic("")
}

// Interface for runtime/VMContext functionality (to avoid circular dependency in Go imports)
type Has_AbortArg interface {
AbortArg()
Expand Down
2 changes: 1 addition & 1 deletion src/systems/filecoin_vm/actor/actor.id
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import ipld "github.com/filecoin-project/specs/libraries/ipld"
// TokenAmount is an amount of Filecoin tokens. This type is used within
// the VM in message execution, to account movement of tokens, payment
// of VM gas, and more.
type TokenAmount UVarint // TODO: bigint or varint?
type TokenAmount Int // TODO: should be BigInt (attoFIL)

// MethodNum is an integer that represents a particular method
// in an actor's function table. These numbers are used to compress
Expand Down
7 changes: 7 additions & 0 deletions src/systems/filecoin_vm/actor/address/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,10 @@ func Address_Make_ActorExec(net Address_NetworkID, hash ActorExecHash) Address {
Data_: Address_Data_Make_ActorExec(hash),
}
}

type Address_Ptr = *Address

func (a *Address_I) Ref() Address_Ptr {
var ret Address = a
return &ret
}
1 change: 1 addition & 0 deletions src/systems/filecoin_vm/actor/address/address.id
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type Address struct {
String() AddressString
IsKeyType() bool
Equals(Address) bool
Ref() Address_Ptr
}

// ActorID is a sequential number assigned to actors in a Filecoin Chain.
Expand Down
Loading