Auto-detect hex encoded bytes in sha3 (#4108)
* Auto-detect hex encoded bytes in sha3 * Using types/isHex * Removing unused imports
This commit is contained in:
@@ -39,7 +39,7 @@ export const lookup = (name, key) => (dispatch, getState) => {
|
||||
name = name.toLowerCase();
|
||||
dispatch(lookupStart(name, key));
|
||||
|
||||
getAddress.call({}, [ sha3(name), key ])
|
||||
getAddress.call({}, [ sha3.text(name), key ])
|
||||
.then((address) => dispatch(success('lookup', address)))
|
||||
.catch((err) => {
|
||||
console.error(`could not lookup ${key} for ${name}`);
|
||||
|
||||
@@ -62,7 +62,7 @@ export const reserve = (name) => (dispatch, getState) => {
|
||||
value: fee
|
||||
};
|
||||
const values = [
|
||||
sha3(name)
|
||||
sha3.text(name)
|
||||
];
|
||||
|
||||
return postTx(api, reserve, options, values);
|
||||
@@ -116,7 +116,7 @@ export const drop = (name) => (dispatch, getState) => {
|
||||
};
|
||||
|
||||
const values = [
|
||||
sha3(name)
|
||||
sha3.text(name)
|
||||
];
|
||||
|
||||
return postTx(api, drop, options, values);
|
||||
|
||||
@@ -54,7 +54,7 @@ export const update = (name, key, value) => (dispatch, getState) => {
|
||||
};
|
||||
|
||||
const values = [
|
||||
sha3(name),
|
||||
sha3.text(name),
|
||||
key,
|
||||
value
|
||||
];
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
export const getOwner = (contract, name) => {
|
||||
const { address, api } = contract;
|
||||
|
||||
const key = api.util.sha3(name) + '0000000000000000000000000000000000000000000000000000000000000001';
|
||||
const key = api.util.sha3.text(name) + '0000000000000000000000000000000000000000000000000000000000000001';
|
||||
const position = api.util.sha3(key, { encoding: 'hex' });
|
||||
|
||||
return api
|
||||
|
||||
Reference in New Issue
Block a user