Skip to content

Commit cc93ebd

Browse files
committed
Add fields to InitAccount
1 parent c7c18cd commit cc93ebd

File tree

12 files changed

+62
-34
lines changed

12 files changed

+62
-34
lines changed

Cargo.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ members = [
2323
]
2424

2525
[workspace.dependencies]
26-
race-core = { path = "core", version = ">=0.0.9" }
27-
race-proc-macro = { path = "proc-macro", version = ">=0.0.9" }
28-
race-client = { path = "client", version = ">=0.0.9" }
29-
race-encryptor = { path = "encryptor", version = ">=0.0.9" }
30-
race-env = { path = "env", version = ">=0.0.9" }
31-
race-test = { path = "test", version = ">=0.0.9" }
32-
race-solana-types = { path = "contracts/solana-types", version = ">=0.0.9", default-features = false }
33-
race-transport = { path = "transport", version = ">=0.0.9" }
26+
race-core = { path = "core", version = ">=0.0.10" }
27+
race-proc-macro = { path = "proc-macro", version = ">=0.0.10" }
28+
race-client = { path = "client", version = ">=0.0.10" }
29+
race-encryptor = { path = "encryptor", version = ">=0.0.10" }
30+
race-env = { path = "env", version = ">=0.0.10" }
31+
race-test = { path = "test", version = ">=0.0.10" }
32+
race-solana-types = { path = "contracts/solana-types", version = ">=0.0.10", default-features = false }
33+
race-transport = { path = "transport", version = ">=0.0.10" }
3434
uuid = { version = "1.1.2", features = ["v4", "fast-rng"] }
3535
syn = "1.0.107"
3636
quote = "1.0.23"
@@ -79,7 +79,7 @@ regex = "1"
7979

8080
[workspace.package]
8181
authors = ["RACE Foundation <[email protected]>"]
82-
version = "0.0.9"
82+
version = "0.0.10"
8383
edition = "2021"
8484
rust-version = "1.65.0"
8585
license = "MPL-2.0"

core/src/engine.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ pub struct InitAccount {
2222
pub data: Vec<u8>,
2323
pub access_version: u64,
2424
pub settle_version: u64,
25+
pub max_players: u16,
26+
pub min_deposit: u64,
27+
pub max_deposit: u64,
2528
}
2629

2730
impl InitAccount {
@@ -38,6 +41,9 @@ impl InitAccount {
3841
data: game_account.data.clone(),
3942
access_version,
4043
settle_version,
44+
max_players: game_account.max_players,
45+
min_deposit: game_account.min_deposit,
46+
max_deposit: game_account.min_deposit,
4147
}
4248
}
4349

@@ -64,6 +70,9 @@ impl InitAccount {
6470
data: game_account.data.clone(),
6571
access_version: transactor_access_version,
6672
settle_version: transactor_settle_version,
73+
max_players: game_account.max_players,
74+
min_deposit: game_account.min_deposit,
75+
max_deposit: game_account.min_deposit,
6776
}
6877
}
6978

@@ -105,6 +114,9 @@ impl Default for InitAccount {
105114
data: Vec::new(),
106115
access_version: 0,
107116
settle_version: 0,
117+
max_players: 10,
118+
min_deposit: 0,
119+
max_deposit: 9999,
108120
}
109121
}
110122
}

js/borsh/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/borsh/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@race-foundation/borsh",
3-
"version": "0.0.26",
3+
"version": "0.0.27",
44
"description": "A borsh implementation with decorator support",
55
"repository": {
66
"type": "git",

js/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/sdk-core/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/sdk-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@race-foundation/sdk-core",
3-
"version": "0.0.26",
3+
"version": "0.0.27",
44
"description": "The type definitions for Race SDK",
55
"scripts": {
66
"test": "jest",

js/sdk-core/src/handler.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export interface IInitAccount {
1717
data: Uint8Array;
1818
accessVersion: bigint;
1919
settleVersion: bigint;
20+
maxPlayers: number;
21+
minDeposit: bigint;
22+
maxDeposit: bigint;
2023
}
2124

2225
export class InitAccount {
@@ -32,13 +35,23 @@ export class InitAccount {
3235
readonly accessVersion: bigint;
3336
@field('u64')
3437
readonly settleVersion: bigint;
38+
@field('u16')
39+
readonly maxPlayers: number;
40+
@field('u64')
41+
readonly minDeposit: bigint;
42+
@field('u64')
43+
readonly maxDeposit: bigint;
44+
3545
constructor(fields: IInitAccount) {
3646
this.addr = fields.addr;
3747
this.accessVersion = fields.accessVersion;
3848
this.settleVersion = fields.settleVersion;
3949
this.data = fields.data;
4050
this.players = fields.players;
4151
this.servers = fields.servers;
52+
this.maxPlayers = fields.maxPlayers;
53+
this.minDeposit = fields.minDeposit;
54+
this.maxDeposit = fields.maxDeposit;
4255
}
4356
static createFromGameAccount(
4457
gameAccount: GameAccount,
@@ -55,6 +68,9 @@ export class InitAccount {
5568
servers,
5669
accessVersion: transactorAccessVersion,
5770
settleVersion: transactorSettleVersion,
71+
maxPlayers: gameAccount.maxPlayers,
72+
minDeposit: gameAccount.minDeposit,
73+
maxDeposit: gameAccount.maxDeposit,
5874
});
5975
}
6076
serialize(): Uint8Array {

js/sdk-facade/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@race-foundation/sdk-facade",
3-
"version": "0.0.26",
3+
"version": "0.0.27",
44
"description": "The Facade integration for Race SDK",
55
"main": "lib/cjs/index.ts",
66
"module": "lib/esm/index.js",

0 commit comments

Comments
 (0)