Fixing CALL cost and PC instruction
This commit is contained in:
		
							parent
							
								
									6ab0ec1097
								
							
						
					
					
						commit
						4520f69ed7
					
				| @ -311,7 +311,8 @@ impl Interpreter { | |||||||
| 				InstructionCost::GasMem(gas, self.mem_needed(stack.peek(0), stack.peek(1))) | 				InstructionCost::GasMem(gas, self.mem_needed(stack.peek(0), stack.peek(1))) | ||||||
| 			}, | 			}, | ||||||
| 			instructions::CALL | instructions::CALLCODE => { | 			instructions::CALL | instructions::CALLCODE => { | ||||||
| 				let gas = add_u256_usize(stack.peek(0), schedule.call_gas); | 				// [todr] we actuall call gas_cost is calculated in ext
 | ||||||
|  | 				let gas = U256::from(schedule.call_gas); | ||||||
| 				let mem = cmp::max( | 				let mem = cmp::max( | ||||||
| 					self.mem_needed(stack.peek(5), stack.peek(6)), | 					self.mem_needed(stack.peek(5), stack.peek(6)), | ||||||
| 					self.mem_needed(stack.peek(3), stack.peek(4)) | 					self.mem_needed(stack.peek(3), stack.peek(4)) | ||||||
| @ -534,7 +535,7 @@ impl Interpreter { | |||||||
| 				ext.sstore(key, word); | 				ext.sstore(key, word); | ||||||
| 			}, | 			}, | ||||||
| 			instructions::PC => { | 			instructions::PC => { | ||||||
| 				stack.push(U256::from(code.position)); | 				stack.push(U256::from(code.position - 1)); | ||||||
| 			}, | 			}, | ||||||
| 			instructions::GAS => { | 			instructions::GAS => { | ||||||
| 				stack.push(gas.clone()); | 				stack.push(gas.clone()); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user