Merge pull request #3554 from ethcore/jg-registry-fee

Use contract Registry fee, not a hard-coded value
This commit is contained in:
Nicolas Gotchac 2016-11-21 15:59:19 +01:00 committed by GitHub
commit a6430c6086

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>. // along with Parity. If not, see <http://www.gnu.org/licenses/>.
import { sha3, toWei } from '../parity.js'; import { sha3 } from '../parity.js';
const alreadyQueued = (queue, action, name) => const alreadyQueued = (queue, action, name) =>
!!queue.find((entry) => entry.action === action && entry.name === name); !!queue.find((entry) => entry.action === action && entry.name === name);
@ -29,6 +29,8 @@ export const reserve = (name) => (dispatch, getState) => {
const state = getState(); const state = getState();
const account = state.accounts.selected; const account = state.accounts.selected;
const contract = state.contract; const contract = state.contract;
const fee = state.fee;
if (!contract || !account) return; if (!contract || !account) return;
if (alreadyQueued(state.names.queue, 'reserve', name)) return; if (alreadyQueued(state.names.queue, 'reserve', name)) return;
const reserve = contract.functions.find((f) => f.name === 'reserve'); const reserve = contract.functions.find((f) => f.name === 'reserve');
@ -36,7 +38,7 @@ export const reserve = (name) => (dispatch, getState) => {
name = name.toLowerCase(); name = name.toLowerCase();
const options = { const options = {
from: account.address, from: account.address,
value: toWei(1).toString() value: fee
}; };
const values = [ sha3(name) ]; const values = [ sha3(name) ];