Skip to content

Commit

Permalink
Update gh-pages
Browse files Browse the repository at this point in the history
Store path: /nix/store/7yzkqqbz2bs2q95s28d58zgpgb68vp6m-tx-village-github-pages
  • Loading branch information
hercules-ci[bot] committed Aug 22, 2024
1 parent a4d7ede commit 09c2834
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 23 deletions.
2 changes: 1 addition & 1 deletion artifacts/tx-bakery-plutip/search-index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 57 additions & 13 deletions artifacts/tx-bakery-plutip/src/tx_bakery_plutip/lib.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,28 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<a href="#206" id="206">206</a>
<a href="#207" id="207">207</a>
<a href="#208" id="208">208</a>
<a href="#209" id="209">209</a>
<a href="#210" id="210">210</a>
<a href="#211" id="211">211</a>
<a href="#212" id="212">212</a>
<a href="#213" id="213">213</a>
<a href="#214" id="214">214</a>
<a href="#215" id="215">215</a>
<a href="#216" id="216">216</a>
<a href="#217" id="217">217</a>
<a href="#218" id="218">218</a>
<a href="#219" id="219">219</a>
<a href="#220" id="220">220</a>
<a href="#221" id="221">221</a>
<a href="#222" id="222">222</a>
<a href="#223" id="223">223</a>
<a href="#224" id="224">224</a>
<a href="#225" id="225">225</a>
<a href="#226" id="226">226</a>
<a href="#227" id="227">227</a>
<a href="#228" id="228">228</a>
<a href="#229" id="229">229</a>
<a href="#230" id="230">230</a>
</pre></div><pre class="rust"><code><span class="kw">use </span>anyhow::anyhow;
<span class="kw">use </span>data_encoding::HEXLOWER;
<span class="kw">use </span>derive_builder::Builder;
Expand Down Expand Up @@ -248,23 +270,40 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>

<span class="attr">#[derive(Debug, Builder, Clone, Deserialize)]
</span><span class="kw">pub struct </span>PlutipConfig {
<span class="attr">#[builder(default = <span class="string">r#""plutip-info.json".try_into().unwrap()"#</span>, setter(skip))]
<span class="doccomment">/// Filepath, where the plutip info dump file will be created
</span><span class="attr">#[builder(default = <span class="string">r#""plutip-info.json".try_into().unwrap()"#</span>, setter(skip))]
</span>dump_path: PathBuf,
<span class="attr">#[builder(default = <span class="string">r#"".wallets".try_into().unwrap()"#</span>, setter(skip))]

<span class="doccomment">/// Directory to store the wallet key files
</span><span class="attr">#[builder(default = <span class="string">r#"".wallets".try_into().unwrap()"#</span>, setter(skip))]
</span>wallets_dir: PathBuf,
<span class="attr">#[builder(default = <span class="string">"false"</span>)]

<span class="doccomment">/// Return verbose logs
</span><span class="attr">#[builder(default = <span class="string">"false"</span>)]
</span>verbose: bool,
<span class="attr">#[builder(default = <span class="string">"1"</span>)]

<span class="doccomment">/// Wallets generated and funded by Plutip
</span><span class="attr">#[builder(default = <span class="string">"1"</span>)]
</span>wallets: u32,
<span class="attr">#[builder(default = <span class="string">"1"</span>)]

<span class="doccomment">/// Initial distribution (unused)
</span><span class="attr">#[builder(default = <span class="string">"1"</span>)]
</span>_ada: u32,
<span class="attr">#[builder(default = <span class="string">"1"</span>)]

<span class="doccomment">/// Initial distribution (unused)
</span><span class="attr">#[builder(default = <span class="string">"1"</span>)]
</span>_lovelace: u32,
<span class="attr">#[builder(default = <span class="string">"1"</span>)]

<span class="doccomment">/// Initial distribution (unused)
</span><span class="attr">#[builder(default = <span class="string">"1"</span>)]
</span>_utxos: u32,
<span class="attr">#[builder(default = <span class="string">"0.2"</span>)]

<span class="doccomment">/// Slot length configuration of the local cluster
</span><span class="attr">#[builder(default = <span class="string">"0.2"</span>)]
</span>slot_length: f32,
<span class="attr">#[builder(default = <span class="string">"80"</span>)]

<span class="doccomment">/// Epoch size configuration of the local cluster
</span><span class="attr">#[builder(default = <span class="string">"80"</span>)]
</span>epoch_size: u32,
}

Expand All @@ -285,7 +324,9 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="kw">impl </span>Plutip {
<span class="kw">const </span>NETWORK: Network = Network::Mainnet;

<span class="kw">pub async fn </span>start(config: PlutipConfig) -&gt; <span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>, PlutipError&gt; {
<span class="doccomment">/// Launching the Plutip local cluster
/// Once the handler goes out of scope, the local cluster will be killed
</span><span class="kw">pub async fn </span>start(config: PlutipConfig) -&gt; <span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>, PlutipError&gt; {
<span class="kw">let </span>handler = Command::new(<span class="string">"local-cluster"</span>)
.arg(<span class="string">"--dump-info-json"</span>)
.arg(<span class="kw-2">&amp;</span>config.dump_path)
Expand Down Expand Up @@ -354,7 +395,8 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
))
}

<span class="kw">pub async fn </span>get_wallet(<span class="kw-2">&amp;</span><span class="self">self</span>, wallet_idx: usize) -&gt; <span class="prelude-ty">Result</span>&lt;KeyWallet, PlutipError&gt; {
<span class="doccomment">/// Get a wallet by an index generated and funded by Plutip
</span><span class="kw">pub async fn </span>get_wallet(<span class="kw-2">&amp;</span><span class="self">self</span>, wallet_idx: usize) -&gt; <span class="prelude-ty">Result</span>&lt;KeyWallet, PlutipError&gt; {
<span class="kw">let </span>filename = <span class="macro">format!</span>(
<span class="string">"signing-key-{}.skey"</span>,
HEXLOWER.encode(<span class="kw-2">&amp;</span><span class="self">self</span>.get_wallet_pkh(wallet_idx).<span class="number">0 </span>.<span class="number">0</span>)
Expand All @@ -364,7 +406,8 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="prelude-val">Ok</span>(KeyWallet::new_enterprise(<span class="kw-2">&amp;</span>path).<span class="kw">await</span><span class="question-mark">?</span>)
}

<span class="kw">pub async fn </span>get_own_wallet(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; <span class="prelude-ty">Result</span>&lt;KeyWallet, PlutipError&gt; {
<span class="doccomment">/// Get the first wallet generated and funded by Plutip
</span><span class="kw">pub async fn </span>get_own_wallet(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; <span class="prelude-ty">Result</span>&lt;KeyWallet, PlutipError&gt; {
<span class="self">self</span>.get_wallet(<span class="number">0</span>).<span class="kw">await
</span>}

Expand All @@ -373,7 +416,8 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="self">self</span>.info.node_socket.clone().try_into().unwrap()
}

<span class="kw">pub fn </span>get_network(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; Network {
<span class="doccomment">/// Get the Cardano network discriminant
</span><span class="kw">pub fn </span>get_network(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; Network {
<span class="self">Self</span>::NETWORK
}

Expand Down
Loading

0 comments on commit 09c2834

Please sign in to comment.