Skip to content

Commit

Permalink
Merge pull request #40 from dfinity/FI-916-add-depositor-candid-file
Browse files Browse the repository at this point in the history
feat(FI-916) add depositor.did file
  • Loading branch information
NikolasHaimerl authored Aug 31, 2023
2 parents fd88e90 + c9f0d44 commit 520616c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions depositor/depositor.did
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type Account = record { owner : principal; subaccount : opt vec nat8 };
type DepositArg = record { to : Account; memo : opt vec nat8; cycles : nat };
type DepositResult = record { balance : nat; txid : nat };
type InitArg = record { ledger_id : principal };
service : (InitArg) -> { deposit : (DepositArg) -> (DepositResult) }
1 change: 1 addition & 0 deletions depositor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ fn with_config<R>(f: impl FnOnce(&Config) -> R) -> R {
fn main() {}

#[init]
#[candid_method(init)]
fn init(arg: InitArg) {
CONFIG.with(|cell| {
*cell.borrow_mut() = Config {
Expand Down
7 changes: 7 additions & 0 deletions dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
"package": "cycles-ledger",
"optimize": "cycles",
"gzip": true
},
"cycles-depositor": {
"type": "rust",
"candid": "./depositor/depositor.did",
"package": "depositor",
"optimize": "cycles",
"gzip": true
}
}
}

0 comments on commit 520616c

Please sign in to comment.