Skip to content

Commit

Permalink
Move EVM.dryCall definition after coa.call
Browse files Browse the repository at this point in the history
  • Loading branch information
m-Peter committed Jan 7, 2025
1 parent cd3d0ca commit d1e1e8e
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions fvm/evm/stdlib/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,30 @@ var InternalEVMTypeDryRunFunctionType = &sema.FunctionType{
ReturnTypeAnnotation: sema.NewTypeAnnotation(sema.AnyStructType),
}

// InternalEVM.dryCall
// InternalEVM.batchRun

const InternalEVMTypeDryCallFunctionName = "dryCall"
const InternalEVMTypeBatchRunFunctionName = "batchRun"

var InternalEVMTypeDryCallFunctionType = &sema.FunctionType{
var InternalEVMTypeBatchRunFunctionType *sema.FunctionType = &sema.FunctionType{
Parameters: []sema.Parameter{
{
Label: "txs",
TypeAnnotation: sema.NewTypeAnnotation(EVMTransactionsBatchBytesType),
},
{
Label: "coinbase",
TypeAnnotation: sema.NewTypeAnnotation(EVMAddressBytesType),
},
},
// Actually [EVM.Result], but cannot refer to it here
ReturnTypeAnnotation: sema.NewTypeAnnotation(sema.NewVariableSizedType(nil, sema.AnyStructType)),
}

// InternalEVM.call

const InternalEVMTypeCallFunctionName = "call"

var InternalEVMTypeCallFunctionType = &sema.FunctionType{
Parameters: []sema.Parameter{
{
Label: "from",
Expand All @@ -209,30 +228,11 @@ var InternalEVMTypeDryCallFunctionType = &sema.FunctionType{
ReturnTypeAnnotation: sema.NewTypeAnnotation(sema.AnyStructType),
}

// InternalEVM.batchRun

const InternalEVMTypeBatchRunFunctionName = "batchRun"

var InternalEVMTypeBatchRunFunctionType *sema.FunctionType = &sema.FunctionType{
Parameters: []sema.Parameter{
{
Label: "txs",
TypeAnnotation: sema.NewTypeAnnotation(EVMTransactionsBatchBytesType),
},
{
Label: "coinbase",
TypeAnnotation: sema.NewTypeAnnotation(EVMAddressBytesType),
},
},
// Actually [EVM.Result], but cannot refer to it here
ReturnTypeAnnotation: sema.NewTypeAnnotation(sema.NewVariableSizedType(nil, sema.AnyStructType)),
}

// InternalEVM.call
// InternalEVM.dryCall

const InternalEVMTypeCallFunctionName = "call"
const InternalEVMTypeDryCallFunctionName = "dryCall"

var InternalEVMTypeCallFunctionType = &sema.FunctionType{
var InternalEVMTypeDryCallFunctionType = &sema.FunctionType{
Parameters: []sema.Parameter{
{
Label: "from",
Expand Down Expand Up @@ -465,12 +465,6 @@ var InternalEVMContractType = func() *sema.CompositeType {
InternalEVMTypeDryRunFunctionType,
"",
),
sema.NewUnmeteredPublicFunctionMember(
ty,
InternalEVMTypeDryCallFunctionName,
InternalEVMTypeDryCallFunctionType,
"",
),
sema.NewUnmeteredPublicFunctionMember(
ty,
InternalEVMTypeBatchRunFunctionName,
Expand All @@ -489,6 +483,12 @@ var InternalEVMContractType = func() *sema.CompositeType {
InternalEVMTypeCallFunctionType,
"",
),
sema.NewUnmeteredPublicFunctionMember(
ty,
InternalEVMTypeDryCallFunctionName,
InternalEVMTypeDryCallFunctionType,
"",
),
sema.NewUnmeteredPublicFunctionMember(
ty,
InternalEVMTypeDepositFunctionName,
Expand Down

0 comments on commit d1e1e8e

Please sign in to comment.