-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proxy exec #1310
Proxy exec #1310
Conversation
libangzhu
commented
Sep 11, 2023
- 增加交易代理执行逻辑
- 调整wallet 模块针对0x地址签名适配的问题
- 在mempool 中检查nonce 问题
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1310 +/- ##
==========================================
+ Coverage 62.00% 62.04% +0.04%
==========================================
Files 171 171
Lines 23752 23788 +36
==========================================
+ Hits 14727 14760 +33
- Misses 7187 7189 +2
- Partials 1838 1839 +1
☔ View full report in Codecov by Sentry. |
func (e *executor) proxyGetRealTx(tx *types.Transaction) (*types.Transaction, error) { | ||
if string(types.GetRealExecName(tx.GetExecer())) != "evm" { | ||
return nil, fmt.Errorf("execName %s not allowd", string(types.GetRealExecName(tx.GetExecer()))) | ||
} | ||
var actionData types.EVMContractAction4Chain33 | ||
err := types.Decode(tx.GetPayload(), &actionData) | ||
if err != nil { | ||
return nil, err | ||
} | ||
if len(actionData.GetPara()) == 0 { | ||
return nil, errors.New("empty tx") | ||
} | ||
var realTx types.Transaction | ||
err = types.Decode(actionData.Para, &realTx) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return &realTx, nil | ||
|
||
} | ||
|
||
func (e *executor) proxyExecTx(tx *types.Transaction) (*types.Transaction, error) { | ||
var realTx = tx | ||
var err error | ||
if tx.To == e.cfg.GetModuleConfig().Exec.ProxyExecAddress { | ||
realTx, err = e.proxyGetRealTx(tx) | ||
if err != nil { | ||
return realTx, err | ||
} | ||
realTx.Signature = tx.Signature | ||
|
||
} | ||
return realTx, nil | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这部分代码建议增加单元测试覆盖
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
plugin 也会增加ci 集成测试
🎉 This PR is included in version 1.68.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |