mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-05 18:42:19 +00:00
bbb3cc978f
* deploy_cairo_smartcontract * deploy_cairo_smartcontract / 2 Add new transaction type for cairo and vm factory * starknet_getcode * deploy_cairo_smartcontract / 3 * deploy_cairo_smartcontract / 4 * deploy_cairo_smartcontract / 5 Co-authored-by: Aleksandr Borodulin <a.borodulin@axioma.lv>
41 lines
734 B
Go
41 lines
734 B
Go
package vm
|
|
|
|
import (
|
|
"github.com/ledgerwatch/erigon/common"
|
|
)
|
|
|
|
func NewCVM(state IntraBlockState) *CVM {
|
|
cvm := &CVM{
|
|
intraBlockState: state,
|
|
}
|
|
|
|
return cvm
|
|
}
|
|
|
|
type CVM struct {
|
|
config Config
|
|
intraBlockState IntraBlockState
|
|
}
|
|
|
|
func (cvm *CVM) Create(code []byte) ([]byte, common.Address, error) {
|
|
address := common.Address{}
|
|
cvm.intraBlockState.SetCode(address, code)
|
|
return code, common.Address{}, nil
|
|
|
|
//TODO:: execute cairo construct
|
|
//ret, err := cvm.run(code)
|
|
}
|
|
|
|
func (cvm *CVM) Config() Config {
|
|
return cvm.config
|
|
}
|
|
|
|
func (cvm *CVM) IntraBlockState() IntraBlockState {
|
|
return cvm.intraBlockState
|
|
}
|
|
|
|
//func (cvm *CVM) run(code []byte) ([]byte, error) {
|
|
// // TODO:: call grpc cairo
|
|
// return code, nil
|
|
//}
|