Skip to content

Commit

Permalink
fix: Correct typo in Erc20BalanceOfRequest (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvolin authored Aug 18, 2023
1 parent 2081573 commit 0e66e6c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/ethereum-canister/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ use std::cell::RefCell;
use candid::Nat;
use ic_cdk::{init, post_upgrade, pre_upgrade, query, update};
use ic_cdk_timers::set_timer;
use interface::{Address, Erc20OwnerOfRequest, Erc721OwnerOfRequest, Network, SetupRequest, U256};
use interface::{
Address, Erc20BalanceOfRequest, Erc721OwnerOfRequest, Network, SetupRequest, U256,
};
use log::{debug, error};

use crate::stable_memory::{
Expand Down Expand Up @@ -70,7 +72,7 @@ async fn get_block_number() -> Nat {
}

#[update]
async fn erc20_balance_of(request: Erc20OwnerOfRequest) -> U256 {
async fn erc20_balance_of(request: Erc20BalanceOfRequest) -> U256 {
erc20::balance_of(request.contract.into(), request.account.into())
.await
.expect("erc20::balance_of failed")
Expand Down
4 changes: 2 additions & 2 deletions src/ethereum-canister/tests/canister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ fn get_block_number() {
}

mod erc20 {
use interface::{Erc20OwnerOfRequest, U256};
use interface::{Erc20BalanceOfRequest, U256};

use super::*;

#[test]
fn balance_of() {
let canister = setup_ethereum_canister();

let request = Erc20OwnerOfRequest {
let request = Erc20BalanceOfRequest {
contract: "0xdAC17F958D2ee523a2206206994597C13D831ec7" // usdt
.parse()
.unwrap(),
Expand Down
2 changes: 1 addition & 1 deletion src/interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct SetupRequest {
}

#[derive(Debug, Clone, PartialEq, Eq, CandidType, Deserialize)]
pub struct Erc20OwnerOfRequest {
pub struct Erc20BalanceOfRequest {
pub contract: Address,
pub account: Address,
}
Expand Down

0 comments on commit 0e66e6c

Please sign in to comment.