Skip to content
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

Merged
merged 15 commits into from
Sep 15, 2023
Merged

Proxy exec #1310

merged 15 commits into from
Sep 15, 2023

Conversation

libangzhu
Copy link
Contributor

  1. 增加交易代理执行逻辑
  2. 调整wallet 模块针对0x地址签名适配的问题
  3. 在mempool 中检查nonce 问题

@codecov
Copy link

codecov bot commented Sep 12, 2023

Codecov Report

Patch coverage: 87.23% and project coverage change: +0.04% 🎉

Comparison is base (77916d3) 62.00% compared to head (0e855c8) 62.04%.

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     
Files Changed Coverage Δ
wallet/wallet_proc.go 59.83% <50.00%> (+0.22%) ⬆️
wallet/sendtx.go 58.33% <80.00%> (ø)
system/mempool/check.go 83.11% <93.93%> (+2.95%) ⬆️

... and 10 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +602 to +637
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
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这部分代码建议增加单元测试覆盖

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok
plugin 也会增加ci 集成测试

@bysomeone bysomeone merged commit d854190 into 33cn:master Sep 15, 2023
14 checks passed
@33cn
Copy link
Owner

33cn commented Apr 12, 2024

🎉 This PR is included in version 1.68.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@33cn 33cn added the released label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants