Create executes the code using the EVM create method
(input []byte, cfg *Config)
| 117 | |
| 118 | // Create executes the code using the EVM create method |
| 119 | func Create(input []byte, cfg *Config) ([]byte, common.Address, uint64, error) { |
| 120 | if cfg == nil { |
| 121 | cfg = new(Config) |
| 122 | } |
| 123 | setDefaults(cfg) |
| 124 | |
| 125 | if cfg.State == nil { |
| 126 | cfg.State, _ = state.New(common.Hash{}, state.NewDatabase(database.NewMemDatabase())) |
| 127 | } |
| 128 | var ( |
| 129 | vmenv = NewEnv(cfg) |
| 130 | sender = vm.AccountRef(cfg.Origin) |
| 131 | ) |
| 132 | |
| 133 | // Call the code with the given configuration. |
| 134 | code, address, leftOverGas, err := vmenv.Create( |
| 135 | sender, |
| 136 | input, |
| 137 | cfg.GasLimit, |
| 138 | cfg.Value, |
| 139 | ) |
| 140 | return code, address, leftOverGas, err |
| 141 | } |
| 142 | |
| 143 | // Call executes the code given by the contract's address. It will return the |
| 144 | // EVM's return value or an error if it failed. |
nothing calls this directly
no test coverage detected