Skip to content

Commit

Permalink
fix: Decrease sync step-size + fix coin overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
OwshenNetwork committed Jan 21, 2024
1 parent bee45da commit 94fcc16
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 61 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "owshen"
version = "0.1.2"
version = "0.1.3"
edition = "2021"

[dependencies]
Expand Down
110 changes: 56 additions & 54 deletions client/src/components/ReceivedCoins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,66 +85,68 @@ const ReceivedCoinList = () => {
</div>
</div>
) : receivedcoins?.length ? (
<ul>
{receivedcoins?.map((coin, index) => (
<li
className=" flex flex-wrap pb-1 items-center border-b-2 border-[#00000033]"
key={index}
>
<div className="w-5/6 text-left font-bold text-lg flex items-center">
<img
className="w-8 mr-2"
src={getLogoByContractAddress(coin.uint_token)}
/>
<p>
{String(trueAmount(coin.amount)).includes(".")
? getRound(Number(trueAmount(coin.amount)))
: `${getRound(trueAmount(coin.amount))}.0`}{" "}
{getNameByContractAddress(coin.uint_token)}
</p>
</div>
{/* <p className="w-1/6 text-lg">
<div className="max-h-350 overflow-y-auto">
<ul>
{receivedcoins?.map((coin, index) => (
<li
className=" flex flex-wrap pb-1 items-center border-b-2 border-[#00000033]"
key={index}
>
<div className="w-5/6 text-left font-bold text-lg flex items-center">
<img
className="w-8 mr-2"
src={getLogoByContractAddress(coin.uint_token)}
/>
<p>
{String(trueAmount(coin.amount)).includes(".")
? getRound(Number(trueAmount(coin.amount)))
: `${getRound(trueAmount(coin.amount))}.0`}{" "}
{getNameByContractAddress(coin.uint_token)}
</p>
</div>
{/* <p className="w-1/6 text-lg">
{String(coin.uint_token).substring(0, 10)}
</p>
<p className="w-1/6 text-lg pl-5">
{coin.index}
</p> */}
<div className=" w-1/6 justify-between flex">
<button
onClick={
() => setIsInprogress(true)
// setIsOpen(true)
}
>
<img
alt=""
width="34px"
className=" border border-gray-300 p-1.5 rounded-3xl"
src={MergIcon}
/>
</button>
<button
className="ml-2"
onClick={() => setIsInprogress(true)}
// withdrawal(coin.index, owshen, address);
// SetSelectedCoin(coin.index);
// setIsOpenWithdraw(true);
// }}
>
<img alt="" src={SendIcon} />
</button>
<div className=" w-1/6 justify-between flex">
<button
onClick={
() => setIsInprogress(true)
// setIsOpen(true)
}
>
<img
alt=""
width="34px"
className=" border border-gray-300 p-1.5 rounded-3xl"
src={MergIcon}
/>
</button>
<button
className="ml-2"
onClick={() => setIsInprogress(true)}
// withdrawal(coin.index, owshen, address);
// SetSelectedCoin(coin.index);
// setIsOpenWithdraw(true);
// }}
>
<img alt="" src={SendIcon} />
</button>

<button
// onClick={() => withdrawHandler(coin)}
onClick={() => setIsInprogress(true)}
className="ml-2"
>
<img alt="" src={SwapIcon} />
</button>
</div>
</li>
))}
</ul>
<button
// onClick={() => withdrawHandler(coin)}
onClick={() => setIsInprogress(true)}
className="ml-2"
>
<img alt="" src={SwapIcon} />
</button>
</div>
</li>
))}
</ul>
</div>
) : (
<p className="text-4xl font-bold mt-28">No coins yet </p>
)}
Expand Down
12 changes: 7 additions & 5 deletions client/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./src/**/*.{js,jsx,ts,tsx}",
],
content: ["./src/**/*.{js,jsx,ts,tsx}"],
theme: {
extend: {},
extend: {
maxHeight: {
350: "350px",
},
},
},
plugins: [],
}
};
2 changes: 1 addition & 1 deletion src/apis/coins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub async fn coins(
.unwrap_or(SparseMerkleTree::new(16));

let mut curr = owshen_contract_deployment_block_number.as_usize();
const STEP: usize = 1000;
const STEP: usize = 200;
let mut spent_events = Vec::new();
let mut sent_events = Vec::new();

Expand Down

0 comments on commit 94fcc16

Please sign in to comment.