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
[gen]update golang gen code #3007
base: master
Are you sure you want to change the base?
Conversation
@@ -621,14 +700,24 @@ func decode_{0}_argument(arg diemtypes.TransactionArgument) (value {1}, err erro | |||
Address => "diemtypes.AccountAddress".into(), | |||
Vector(type_tag) => match type_tag.as_ref() { | |||
U8 => "[]byte".into(), | |||
U128 => "diemtypes.VecU128".into(), |
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.
diemtypes 这个 prefix 是不是也可以考虑改一下?要不就改成 movetypes ?
Bool => format!("TransactionArgument__Bool(value={})", name), | ||
U8 => format!("TransactionArgument__U8(value={})", name), | ||
U64 => format!("TransactionArgument__U64(value={})", name), | ||
U128 => format!("TransactionArgument__U128(value={})", name), | ||
Address => format!("TransactionArgument__Address(value={})", name), |
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.
这个改了也会影响 python3 的生成代码吧?
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.
@fikgol python sdk 现在用了代码生成了吗?
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.
用了,为啥要改python3的
|
||
#[ignore] | ||
#[test] | ||
fn test_that_golang_code_compiles_and_demo_runs() { |
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.
是不是我们考虑在 ci 上安装环境,把这个 test 打开,保证每次修改都能正常生成代码
@@ -515,6 +584,9 @@ var script_function_decoder_map = map[string]func(diemtypes.TransactionPayload) | |||
Address => ("Address", "value = arg.Value".into()), | |||
Vector(type_tag) => match type_tag.as_ref() { | |||
U8 => ("U8Vector", default_stmt), | |||
U128 => ("VecU128", default_stmt), |
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.
每支持一种 vector 就要增加一个新类型,感觉有点笨,但貌似暂时也没很好的办法。以后考虑支持泛型的语言可以用更优雅一些的办法。提过一个 issue diem/diem#8628
Bool => format!("TransactionArgument__Bool(value={})", name), | ||
U8 => format!("TransactionArgument__U8(value={})", name), | ||
U64 => format!("TransactionArgument__U64(value={})", name), | ||
U128 => format!("TransactionArgument__U128(value={})", name), | ||
Address => format!("TransactionArgument__Address(value={})", name), |
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.
用了,为啥要改python3的
starcoin_types.yml 文件会自动重新生成 |
No description provided.