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

wip: nits on dev process #57

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 4 additions & 37 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,12 @@

> ⚠️ NOTE: Use notes like this to emphasize something important about the PR.
>
> This could include other PRs this PR is built on top of; API breaking changes; reasons for why the PR is on hold; or anything else you would like to draw attention to.

| Status | Type | ⚠️ Core Change | Issue |
| :---: | :---: | :---: | :--: |
| Ready/Hold | Feature/Bug/Tooling/Refactor/Hotfix | Yes/No | [Link](<Issue link here>) |

## Problem
# Problem

_What problem are you trying to solve?_


## Solution
# Solution

_How did you solve the problem?_

# Other changes (e.g. bug fixes, small refactors)

## Before & After Screenshots

_Insert screenshots of example code output_

**BEFORE**:
[insert screenshot here]

**AFTER**:
[insert screenshot here]


## Other changes (e.g. bug fixes, small refactors)


## Deploy Notes

_Notes regarding deployment of the contained body of work. These should note any
new dependencies, new scripts, etc._

**New scripts**:

- `script` : script details

**New dependencies**:

- `dependency` : dependency details
_What other unrelated changes are included in this PR ?_
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"workbench.colorCustomizations": {
"activityBar.background": "#13341D",
"titleBar.activeBackground": "#1B4829",
"titleBar.activeForeground": "#F7FCF9"
}
}
1 change: 0 additions & 1 deletion cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ fn init(
fs::create_dir(&project_name)?;
}
std::env::set_current_dir(&project_name)?;
fs::create_dir_all("app")?;

let mut cfg = Config::default();
let jest = test_template == anchor_cli::rust_template::TestTemplate::Jest;
Expand Down
18 changes: 13 additions & 5 deletions cli/src/rust_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ declare_id!("{}");
#[system]
pub mod {} {{

pub fn execute(ctx: Context<Components>, _args_p: Vec<u8>) -> Result<Components> {{
pub fn execute(ctx: Context<Components>, args: Args) -> Result<Components> {{
let position = &mut ctx.accounts.position;
position.x += 1;
position.y += 1;
position.x += args.x;
position.y += args.y;
Ok(ctx.accounts)
}}

Expand All @@ -110,6 +110,11 @@ pub mod {} {{
pub position: Position,
}}

#[arguments]
struct Args {{
pub x: i64,
pub y: i64,
}}
}}
"#,
anchor_cli::rust_template::get_or_create_program_id(name),
Expand Down Expand Up @@ -472,7 +477,11 @@ describe("{}", () => {{
entities: [{{
entity: entityPda,
components: [{{ componentId: positionComponent.programId }}],
}}]
}}],
args: {{
x: 1,
y: 1,
}}
}});
const txSign = await provider.sendAndConfirm(applySystem.transaction);
console.log(`Applied a system. Signature: ${{txSign}}`);
Expand All @@ -483,7 +492,6 @@ describe("{}", () => {{
);
expect(positionAfter.x.toNumber()).to.gt(0);
}});

}});
"#,
name.to_upper_camel_case(),
Expand Down
Loading