@nomicfoundation/edr 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +8 -8
  2. package/src/result.rs +20 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nomicfoundation/edr",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "files": [
@@ -46,13 +46,13 @@
46
46
  "node": ">= 18"
47
47
  },
48
48
  "dependencies": {
49
- "@nomicfoundation/edr-darwin-arm64": "0.4.1",
50
- "@nomicfoundation/edr-darwin-x64": "0.4.1",
51
- "@nomicfoundation/edr-linux-arm64-gnu": "0.4.1",
52
- "@nomicfoundation/edr-linux-arm64-musl": "0.4.1",
53
- "@nomicfoundation/edr-linux-x64-gnu": "0.4.1",
54
- "@nomicfoundation/edr-linux-x64-musl": "0.4.1",
55
- "@nomicfoundation/edr-win32-x64-msvc": "0.4.1"
49
+ "@nomicfoundation/edr-darwin-arm64": "0.4.2",
50
+ "@nomicfoundation/edr-darwin-x64": "0.4.2",
51
+ "@nomicfoundation/edr-linux-arm64-gnu": "0.4.2",
52
+ "@nomicfoundation/edr-linux-arm64-musl": "0.4.2",
53
+ "@nomicfoundation/edr-linux-x64-gnu": "0.4.2",
54
+ "@nomicfoundation/edr-linux-x64-musl": "0.4.2",
55
+ "@nomicfoundation/edr-win32-x64-msvc": "0.4.2"
56
56
  },
57
57
  "scripts": {
58
58
  "artifacts": "napi artifacts",
package/src/result.rs CHANGED
@@ -16,6 +16,7 @@ pub enum SuccessReason {
16
16
  Return,
17
17
  /// The opcode `SELFDESTRUCT` was called
18
18
  SelfDestruct,
19
+ EofReturnContract,
19
20
  }
20
21
 
21
22
  impl From<edr_evm::SuccessReason> for SuccessReason {
@@ -24,6 +25,7 @@ impl From<edr_evm::SuccessReason> for SuccessReason {
24
25
  edr_evm::SuccessReason::Stop => Self::Stop,
25
26
  edr_evm::SuccessReason::Return => Self::Return,
26
27
  edr_evm::SuccessReason::SelfDestruct => Self::SelfDestruct,
28
+ edr_evm::SuccessReason::EofReturnContract => Self::EofReturnContract,
27
29
  }
28
30
  }
29
31
  }
@@ -34,6 +36,7 @@ impl From<SuccessReason> for edr_evm::SuccessReason {
34
36
  SuccessReason::Stop => Self::Stop,
35
37
  SuccessReason::Return => Self::Return,
36
38
  SuccessReason::SelfDestruct => Self::SelfDestruct,
39
+ SuccessReason::EofReturnContract => Self::EofReturnContract,
37
40
  }
38
41
  }
39
42
  }
@@ -82,7 +85,7 @@ pub struct RevertResult {
82
85
  pub enum ExceptionalHalt {
83
86
  OutOfGas,
84
87
  OpcodeNotFound,
85
- InvalidFEOpcode,
88
+ InvalidEFOpcode,
86
89
  InvalidJump,
87
90
  NotActivated,
88
91
  StackUnderflow,
@@ -97,6 +100,12 @@ pub enum ExceptionalHalt {
97
100
  CreateContractStartingWithEF,
98
101
  /// EIP-3860: Limit and meter initcode. Initcode size limit exceeded.
99
102
  CreateInitCodeSizeLimit,
103
+ /// Aux data overflow, new aux data is larger tha u16 max size.
104
+ EofAuxDataOverflow,
105
+ /// Aud data is smaller then already present data size.
106
+ EofAuxDataTooSmall,
107
+ /// EOF Subroutine stack overflow
108
+ EOFFunctionStackOverflow,
100
109
  }
101
110
 
102
111
  impl From<edr_evm::HaltReason> for ExceptionalHalt {
@@ -104,7 +113,7 @@ impl From<edr_evm::HaltReason> for ExceptionalHalt {
104
113
  match halt {
105
114
  edr_evm::HaltReason::OutOfGas(..) => ExceptionalHalt::OutOfGas,
106
115
  edr_evm::HaltReason::OpcodeNotFound => ExceptionalHalt::OpcodeNotFound,
107
- edr_evm::HaltReason::InvalidFEOpcode => ExceptionalHalt::InvalidFEOpcode,
116
+ edr_evm::HaltReason::InvalidEFOpcode => ExceptionalHalt::InvalidEFOpcode,
108
117
  edr_evm::HaltReason::InvalidJump => ExceptionalHalt::InvalidJump,
109
118
  edr_evm::HaltReason::NotActivated => ExceptionalHalt::NotActivated,
110
119
  edr_evm::HaltReason::StackUnderflow => ExceptionalHalt::StackUnderflow,
@@ -122,6 +131,11 @@ impl From<edr_evm::HaltReason> for ExceptionalHalt {
122
131
  edr_evm::HaltReason::CreateInitCodeSizeLimit => {
123
132
  ExceptionalHalt::CreateInitCodeSizeLimit
124
133
  }
134
+ edr_evm::HaltReason::EofAuxDataOverflow => ExceptionalHalt::EofAuxDataOverflow,
135
+ edr_evm::HaltReason::EofAuxDataTooSmall => ExceptionalHalt::EofAuxDataTooSmall,
136
+ edr_evm::HaltReason::EOFFunctionStackOverflow => {
137
+ ExceptionalHalt::EOFFunctionStackOverflow
138
+ }
125
139
  edr_evm::HaltReason::OverflowPayment
126
140
  | edr_evm::HaltReason::StateChangeDuringStaticCall
127
141
  | edr_evm::HaltReason::CallNotAllowedInsideStatic
@@ -138,7 +152,7 @@ impl From<ExceptionalHalt> for edr_evm::HaltReason {
138
152
  match value {
139
153
  ExceptionalHalt::OutOfGas => Self::OutOfGas(edr_evm::OutOfGasError::Basic),
140
154
  ExceptionalHalt::OpcodeNotFound => Self::OpcodeNotFound,
141
- ExceptionalHalt::InvalidFEOpcode => Self::InvalidFEOpcode,
155
+ ExceptionalHalt::InvalidEFOpcode => Self::InvalidEFOpcode,
142
156
  ExceptionalHalt::InvalidJump => Self::InvalidJump,
143
157
  ExceptionalHalt::NotActivated => Self::NotActivated,
144
158
  ExceptionalHalt::StackUnderflow => Self::StackUnderflow,
@@ -150,6 +164,9 @@ impl From<ExceptionalHalt> for edr_evm::HaltReason {
150
164
  ExceptionalHalt::CreateContractSizeLimit => Self::CreateContractSizeLimit,
151
165
  ExceptionalHalt::CreateContractStartingWithEF => Self::CreateContractStartingWithEF,
152
166
  ExceptionalHalt::CreateInitCodeSizeLimit => Self::CreateInitCodeSizeLimit,
167
+ ExceptionalHalt::EofAuxDataOverflow => Self::EofAuxDataOverflow,
168
+ ExceptionalHalt::EofAuxDataTooSmall => Self::EofAuxDataTooSmall,
169
+ ExceptionalHalt::EOFFunctionStackOverflow => Self::EOFFunctionStackOverflow,
153
170
  }
154
171
  }
155
172
  }