Timeline for Returned error: gas required exceeds allowance (8000000) or always failing transaction
Current License: CC BY-SA 4.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 25, 2020 at 17:44 | history | edited | goodvibration | CC BY-SA 4.0 |
added 19 characters in body
|
Mar 25, 2020 at 16:49 | vote | accept | Ruchita | ||
Mar 25, 2020 at 16:47 | comment | added | goodvibration | Added as an answer then... | |
Mar 25, 2020 at 16:36 | answer | added | goodvibration | timeline score: 1 | |
Mar 25, 2020 at 16:21 | comment | added | Ruchita | @goodvibration: I used departmentEmployees.push(_employeeId) and it worked!! Thanks for your help!! | |
Mar 25, 2020 at 16:10 | review | Close votes | |||
Mar 25, 2020 at 16:30 | |||||
Mar 25, 2020 at 14:55 | history | edited | Ruchita | CC BY-SA 4.0 |
deleted 1 character in body
|
Mar 25, 2020 at 14:54 | comment | added | goodvibration |
Also, being that departmentEmployees is a dynamic array, the assignment departmentEmployees[_employeeId] = _employeeId would naturally revert. You should either change that variable to a mapping , or use departmentEmployees.push(_employeeId) instead of what you're doing now.
|
|
Mar 25, 2020 at 14:51 | comment | added | goodvibration |
Both addEmployee and updateEmployeeOrder start with a require statement. Have you made sure that this statement is fulfilled (i.e., that the expression inside it evaluates to true )? You would obviously get your transaction "always failing" otherwise.
|
|
Mar 25, 2020 at 14:47 | history | asked | Ruchita | CC BY-SA 4.0 |