Skip to content

Commit

Permalink
Upgrade mina-signer to v1.7.0 & Upgrade webpack to v5
Browse files Browse the repository at this point in the history
  • Loading branch information
lvshaoping007 committed Jan 15, 2023
1 parent 1ff8a8b commit fda7509
Show file tree
Hide file tree
Showing 12 changed files with 548 additions and 154 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

## [Un-Released]

## [2.1.4]
- Upgrade mina-signer to v1.7.0
- Upgrade webpack to v5
- Bug fix

## [2.1.3]
- Add transaction memo parse
Expand Down
17 changes: 12 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auro-wallet",
"version": "2.1.3",
"version": "2.1.4",
"private": true,
"dependencies": {
"@ledgerhq/hw-transport-webusb": "5.46.0",
Expand All @@ -16,7 +16,7 @@
"i18next": "19.8.4",
"libsodium-wrappers": "0.7.9",
"mina-ledger-js": "1.0.6",
"mina-signer": "1.6.0",
"mina-signer": "1.7.0",
"obs-store": "4.0.3",
"prop-types": "15.7.2",
"qrcode-generator": "1.4.4",
Expand Down Expand Up @@ -88,10 +88,17 @@
"copy-webpack-plugin": "6.3.2",
"mocha": "8.3.2",
"url-loader": "4.1.1",
"webpack": "4.44.2",
"webpack-cli": "4.2.0",
"webpack": "5.75.0",
"webpack-cli": "5.0.1",
"sass": "1.43.4",
"css-loader":"4.3.0",
"style-loader": "1.3.0"
"style-loader": "1.3.0",
"@babel/helper-string-parser":"7.19.4",
"@babel/helper-environment-visitor":"7.18.9",
"sass-loader":"13.2.0",
"crypto-browserify":"3.12.0",
"stream-browserify":"3.0.0",
"path-browserify":"1.0.1",
"process":"0.11.10"
}
}
2 changes: 1 addition & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"short_name": "__MSG_appName__",
"description": "__MSG_appDescription__",
"manifest_version": 2,
"version": "2.1.3",
"version": "2.1.4",
"default_locale": "en",
"icons": {
"16": "img/logo/16.png",
Expand Down
3 changes: 3 additions & 0 deletions src/background/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ export async function fetchDelegationInfo(publicKey) {
export async function fetchStakingList() {
let netConfig = getCurrentNetConfig()
let baseUrl = netConfig.txUrl
if(netConfig.netType !== NET_CONFIG_TYPE.Mainnet){
return []
}
if (!baseUrl) {
return []
}
Expand Down
6 changes: 5 additions & 1 deletion src/popup/pages/ImportAccount/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ const ImportAccount = ({ }) => {
} else {
dispatch(updateCurrentAccount(account))
setTimeout(() => {
history.go(-(history.length-2))
if(history.length>=4){
history.go(-3)
}else{
history.replace("/")
}
}, 50);
}
})
Expand Down
6 changes: 5 additions & 1 deletion src/popup/pages/ImportKeypair/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ const ImportKeypair = ({ }) => {
} else {
dispatch(updateCurrentAccount(account))
setTimeout(() => {
history.go(-(history.length-2))
if(history.length>=4){
history.go(-3)
}else{
history.replace("/")
}
}, 300);
}
})
Expand Down
2 changes: 2 additions & 0 deletions src/popup/pages/Lock/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { resetWallet } from "../../../reducers";
import { initCurrentAccount } from "../../../reducers/accountReducer";
import { updateExtensionBaseInfo } from "../../../reducers/cache";
import { updateCurrencyConfig } from "../../../reducers/currency";
import { ENTRY_WITCH_ROUTE, updateEntryWitchRoute } from "../../../reducers/entryRouteReducer";
import { updateNetConfig } from "../../../reducers/network";
import { sendMsg } from "../../../utils/commonMsg";
import { sendNetworkChangeMsg } from "../../../utils/utils";
Expand Down Expand Up @@ -66,6 +67,7 @@ export const LockPage = ({
Toast.info(account.error)
}
} else {
dispatch(updateEntryWitchRoute(ENTRY_WITCH_ROUTE.HOME_PAGE))
dispatch(initCurrentAccount(account))
onClickUnLock()
if (!onDappConfirm) {
Expand Down
2 changes: 1 addition & 1 deletion src/popup/pages/Send/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ const SendPage = ({ }) => {
return
}
let amountValue = trimSpace(amount)
if (!isNumber(amountValue) || !new BigNumber(amountValue).gt(0)) {
if (!isNumber(amountValue) || !new BigNumber(amountValue).gte(0)) {
Toast.info(i18n.t('amountError'))
return
}
Expand Down
9 changes: 8 additions & 1 deletion src/popup/pages/StakingList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ import Button from "../../component/Button";
import CustomView from "../../component/CustomView";
import styles from './index.module.scss';
import Input from "../../component/Input";
import { NET_CONFIG_TYPE } from "../../../constant/walletType";

const StakingList = ({ }) => {

const history = useHistory()
const dispatch = useDispatch()
const stakingList = useSelector(state => state.staking.stakingList)
const netType = useSelector(state => state.network.currentConfig.netType)
const stakingList = useSelector(state => {
if(netType === NET_CONFIG_TYPE.Mainnet){
return state.staking.stakingList
}
return []
})

const [keywords, setKeywords] = useState("")
const [currentSelectAddress, setCurrentSelectAddress] = useState("")
Expand Down
4 changes: 2 additions & 2 deletions src/popup/pages/StakingTransfer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const StakingTransfer = () => {
const {
menuAdd, nodeName, nodeAddress, showNodeName
} = useMemo(() => {
let params = history.location?.params
let params = history.location?.params || {}

let menuAdd = !!params.menuAdd
let nodeName = params.nodeName
Expand Down Expand Up @@ -120,7 +120,7 @@ const StakingTransfer = () => {
}
}, () => { })
}
history.go(-(history.length-1))
history.replace("/")
}, [history])


Expand Down
28 changes: 13 additions & 15 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,9 @@ module.exports = (env, argv) => {
]
},
{
test: /\.js$/, exclude: /node_modules/, loader: "babel-loader",
},
{
test: /\.jsx$/,
exclude: /(node_modules)/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/env", "@babel/react"],
},
},
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: "babel-loader",
},
{
test: sassRegex,
Expand Down Expand Up @@ -118,10 +110,14 @@ module.exports = (env, argv) => {
],
},
plugins: getPlugins(),
// performance: getPerformance(),
node: {
fs: 'empty',
'child_process': 'empty'
resolve:{
fallback:{
'child_process': 'empty',
"crypto": require.resolve("crypto-browserify"),
"stream": require.resolve("stream-browserify"),
"path": require.resolve("path-browserify"),
"buffer": require.resolve("safe-buffer"),
},
},
};
if (isDev) {
Expand Down Expand Up @@ -154,6 +150,8 @@ function getPlugins() {
}),
new webpack.ProvidePlugin({
React: "react",
Buffer: ['buffer', 'Buffer'],
process: 'process/browser.js',
})
);
return plugins;
Expand Down
Loading

0 comments on commit fda7509

Please sign in to comment.