Skip to content

Commit

Permalink
Update private fee switch
Browse files Browse the repository at this point in the history
  • Loading branch information
iamalwaysuncomfortable committed Oct 3, 2023
1 parent 6053edb commit 1207a12
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion sdk/package-lock.json

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

6 changes: 5 additions & 1 deletion wasm/src/programs/manager/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ impl ProgramManager {
let mut new_process;
let process = get_process!(self, cache, new_process);
let stack = process.get_stack("credits.aleo").map_err(|e| e.to_string())?;
let fee_identifier = IdentifierNative::from_str("fee").map_err(|e| e.to_string())?;
let fee_identifier = if fee_record.is_some() {
IdentifierNative::from_str("fee_private").map_err(|e| e.to_string())?
} else {
IdentifierNative::from_str("fee_public").map_err(|e| e.to_string())?
};
if !stack.contains_proving_key(&fee_identifier) && fee_proving_key.is_some() && fee_verifying_key.is_some() {
let fee_proving_key = fee_proving_key.clone().unwrap();
let fee_verifying_key = fee_verifying_key.clone().unwrap();
Expand Down
6 changes: 5 additions & 1 deletion wasm/src/programs/manager/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ impl ProgramManager {

let mut new_process;
let process = get_process!(self, cache, new_process);
let fee_identifier = IdentifierNative::from_str("fee").map_err(|e| e.to_string())?;
let fee_identifier = if fee_record.is_some() {
IdentifierNative::from_str("fee_private").map_err(|e| e.to_string())?
} else {
IdentifierNative::from_str("fee_public").map_err(|e| e.to_string())?
};
let stack = process.get_stack("credits.aleo").map_err(|e| e.to_string())?;
if !stack.contains_proving_key(&fee_identifier) && fee_proving_key.is_some() && fee_verifying_key.is_some() {
let fee_proving_key = fee_proving_key.clone().unwrap();
Expand Down
2 changes: 1 addition & 1 deletion website/src/tabs/develop/Deploy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export const Deploy = () => {
/>
</Form.Item>
<Form.Item
label="Private Fee?"
label="Private Fee"
name="private_fee"
valuePropName="checked"
initialValue={true}
Expand Down
2 changes: 1 addition & 1 deletion website/src/tabs/develop/ExecuteLegacy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ export const ExecuteLegacy = () => {
)}
{executeOnline === true && (
<Form.Item
label="Private Fee?"
label="Private Fee"
name="private_fee"
valuePropName="checked"
initialValue={true}
Expand Down
2 changes: 1 addition & 1 deletion website/src/tabs/develop/Join.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export const Join = () => {
/>
</Form.Item>
<Form.Item
label="Private Fee?"
label="Private Fee"
name="private_fee"
valuePropName="checked"
initialValue={true}
Expand Down
2 changes: 1 addition & 1 deletion website/src/tabs/develop/Transfer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ export const Transfer = () => {
/>
</Form.Item>
<Form.Item
label="Private Fee?"
label="Private Fee"
name="private_fee"
valuePropName="checked"
initialValue={true}
Expand Down
6 changes: 3 additions & 3 deletions website/src/tabs/develop/execute/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,13 +363,13 @@ export const Execute = () => {
/>
</Form.Item>
<Form.Item
label="Private Fee?"
label="Private Fee"
name="private_fee"
valuePropName="checked"
initialValue={false}
initialValue={true}
hidden={!getFieldValue("execute_onchain")}
>
<Switch />
<Switch defaultChecked />
</Form.Item>
<Form.Item
noStyle
Expand Down

0 comments on commit 1207a12

Please sign in to comment.