File tree 1 file changed +12
-0
lines changed
packages/providers/src.ts 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -183,10 +183,22 @@ export class JsonRpcSigner extends Signer implements TypedDataSigner {
183
183
transaction . gasLimit = this . provider . estimateGas ( estimate ) ;
184
184
}
185
185
186
+ if ( transaction . to != null ) {
187
+ transaction . to = Promise . resolve ( transaction . to ) . then ( async ( to ) => {
188
+ if ( to == null ) { return null ; }
189
+ const address = await this . provider . resolveName ( to ) ;
190
+ if ( address == null ) {
191
+ logger . throwArgumentError ( "provided ENS name resolves to null" , "tx.to" , to ) ;
192
+ }
193
+ return address ;
194
+ } ) ;
195
+ }
196
+
186
197
return resolveProperties ( {
187
198
tx : resolveProperties ( transaction ) ,
188
199
sender : fromAddress
189
200
} ) . then ( ( { tx, sender } ) => {
201
+
190
202
if ( tx . from != null ) {
191
203
if ( tx . from . toLowerCase ( ) !== sender ) {
192
204
logger . throwArgumentError ( "from address mismatch" , "transaction" , transaction ) ;
You can’t perform that action at this time.
0 commit comments