Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
cleanup
  • Loading branch information
fbielejec committed Aug 16, 2022
commit 78723ad2629a0fb6d358ebc3b6994bf2e041c57a
2 changes: 1 addition & 1 deletion contracts/access_control/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mod access_control {
};
use scale::{Decode, Encode};

// address placeholder, set in the bytecode
// address placeholder, to be set in the bytecode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: privileges on line 90.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 43 as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I found just one typo, could you comment on the line?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pub priviledges: Mapping<(AccountId, Role), ()>,

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And later uses. I do not see the second typo as well, so must have mixed up files. Will find it in a sec.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It crops up a couple of times in 3 files contracts/button/lib.rs (

/// Returned if a call is made from an account with missing access control priviledges
), contracts/access_control/lib.rs (these are the ones you have probably already fixed) and contracts/scripts/deploy.sh (in comments).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, should be fixed now

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deploy.sh still has a couple in comments, upper case. Other than that, fixed.

// 4465614444656144446561444465614444656144446561444465614444656144 => 5DcPEG9AQ4Y9Lo9C5WXuKJDDawens77jWxZ6zGChnm8y8FUX
pub const ACCESS_CONTROL_PUBKEY: [u8; 32] = *b"DeaDDeaDDeaDDeaDDeaDDeaDDeaDDeaD";
pub const HAS_ROLE_SELECTOR: [u8; 4] = [0, 0, 0, 3];
Expand Down
13 changes: 2 additions & 11 deletions contracts/back_to_the_future/Cargo.lock

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

4 changes: 0 additions & 4 deletions contracts/back_to_the_future/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals
scale-info = { version = "2", default-features = false, features = ["derive"], optional = true }

button = { path = "../button", default-features = false }
game_token = { path = "../game_token", default-features = false, features = ["ink-as-dependency"] }
ticket_token = { path = "../ticket_token", default-features = false, features = ["ink-as-dependency"] }
access_control = { path = "../access_control", default-features = false, features = ["ink-as-dependency"] }

[lib]
Expand All @@ -34,8 +32,6 @@ crate-type = [
default = ["std"]
std = [
"button/std",
"game_token/std",
"ticket_token/std",
"ink_env/std",
"ink_lang_codegen/std",
"ink_metadata/std",
Expand Down
15 changes: 3 additions & 12 deletions contracts/back_to_the_future/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ mod back_to_the_future {
use button::{
ButtonData, ButtonGame, ButtonGameEnvironment, ButtonResult, GameError, IButtonGame,
};
use game_token::MINT_TO_SELECTOR;
use ink_env::Error as InkEnvError;
use ink_lang::{
codegen::{initialize_contract, EmitEvent},
reflect::ContractEventBase,
};
use ink_prelude::format;
use ink_storage::traits::SpreadAllocate;
use ticket_token::{BALANCE_OF_SELECTOR, TRANSFER_SELECTOR};

type Event = <BackToTheFuture as ContractEventBase>::Type;

Expand Down Expand Up @@ -111,14 +109,7 @@ mod back_to_the_future {
let now = Self::env().block_number();
let this = self.env().account_id();

ButtonGame::press::<ButtonGameEnvironment>(
self,
TRANSFER_SELECTOR,
MINT_TO_SELECTOR,
now,
caller,
this,
)?;
ButtonGame::press::<ButtonGameEnvironment>(self, now, caller, this)?;

Self::emit_event(
self.env(),
Expand All @@ -135,7 +126,7 @@ mod back_to_the_future {
fn reset(&mut self) -> ButtonResult<()> {
let now = Self::env().block_number();

ButtonGame::reset::<ButtonGameEnvironment>(self, now, MINT_TO_SELECTOR)?;
ButtonGame::reset::<ButtonGameEnvironment>(self, now)?;

Self::emit_event(self.env(), Event::GameReset(GameReset { when: now }));
Ok(())
Expand Down Expand Up @@ -170,7 +161,7 @@ mod back_to_the_future {
#[ink(message)]
fn balance(&self) -> ButtonResult<Balance> {
let this = self.env().account_id();
ButtonGame::balance::<ButtonGameEnvironment>(self, BALANCE_OF_SELECTOR, this)
ButtonGame::balance::<ButtonGameEnvironment>(self, this)
}

#[ink(message)]
Expand Down
30 changes: 30 additions & 0 deletions contracts/button/Cargo.lock

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

2 changes: 2 additions & 0 deletions contracts/button/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals
scale-info = { version = "2", default-features = false, features = ["derive"], optional = true }

access_control = { path = "../access_control", default-features = false, features = ["ink-as-dependency"] }
game_token = { path = "../game_token", default-features = false, features = ["ink-as-dependency"] }
ticket_token = { path = "../ticket_token", default-features = false, features = ["ink-as-dependency"] }
openbrush = { git = "https://github.com/Supercolony-net/openbrush-contracts.git", rev = "8a20f95", default-features = false, features = ["psp22"] }
num = {version = "0.4.0", default-features = false}

Expand Down
Loading