Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added 3 tables categories, categories_proposals, and proposals the sa… #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eoliveros
Copy link
Contributor

…me as zapd.

Copied the mainnet proposals screen. Not complete. It's not sending email notifications at the moment. Not sure how we sending the rebates, needs clarification.

@eoliveros eoliveros force-pushed the proposals-feature-20210316 branch 6 times, most recently from e0a6e2f to d09ae99 Compare March 28, 2021 04:18
@eoliveros eoliveros force-pushed the proposals-feature-20210316 branch 2 times, most recently from abb0f75 to 049cd31 Compare April 1, 2021 02:10
@eoliveros
Copy link
Contributor Author

submitted changes. But still need to figure certain things.

Copy link
Contributor

@djpnewton djpnewton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also we need to remove the 'wallet_address' field from the Users table and just have one wallet address for the user defined from the recovery words

tx_utils.py Outdated Show resolved Hide resolved
templates/claim_payment.html Outdated Show resolved Hide resolved
@eoliveros
Copy link
Contributor Author

Also we need to remove the 'wallet_address' field from the Users table and just have one wallet address for the user defined from the recovery words

Does that mean the user will only be using one wallet_address? ie. their merchant_app seed would be the same as the seed thats being stored in merchat_server?

@djpnewton
Copy link
Contributor

Also we need to remove the 'wallet_address' field from the Users table and just have one wallet address for the user defined from the recovery words

Does that mean the user will only be using one wallet_address? ie. their merchant_app seed would be the same as the seed thats being stored in merchat_server?

yes

@eoliveros
Copy link
Contributor Author

eoliveros commented Apr 6, 2021

Also we need to remove the 'wallet_address' field from the Users table and just have one wallet address for the user defined from the recovery words

Does that mean the user will only be using one wallet_address? ie. their merchant_app seed would be the same as the seed thats being stored in merchat_server?

yes

I'm going to need a version of the merchant app that recognizes the qrcode. At the moment, when scan using the merchant app, its giving me invalid qrcode.

Also need to do do the following to get user.wallet_address out of the db. Currently, seeing the following:

    @classmethod
    def update_wallet_address(cls, session, user):
        if user.wallet_address:
            # update txs
            limit = 100
            oldest_txid = None
            txs = []
            while True:
                have_tx = False
                txs = blockchain_transactions(logger, app.config["NODE_ADDRESS"], user.wallet_address, limit, oldest_txid)
                for tx in txs:
                    oldest_txid = tx["id"]
                    have_tx = MerchantTx.exists(db.session, user, oldest_txid)
                    if have_tx:
                        break
                    if tx["type"] == 4 and tx["assetId"] == app.config["ASSET_ID"]:
                        amount_nzd = apply_merchant_rate(tx['amount'], user, app.config, use_fixed_fee=False)
                        date = datetime.datetime.fromtimestamp(tx['timestamp'] / 1000)
                        session.add(MerchantTx(user, date, user.wallet_address, tx['amount'], amount_nzd, tx['id'], tx['direction'], tx['attachment']))
                if have_tx or len(txs) < limit:
                    break
            session.commit()

Which appears to being used in the MerchantTxModelView.

    @expose("/update")
    def update(self):
        if not current_user.wallet_address:
            flash('Account does not have wallet address set')
        else:
            MerchantTx.update_wallet_address(db.session, current_user)
            flash('Updated')
        return redirect('./')

need to figure a way to remove the user.wallet_address without getting affected.

Actually, this appears for updating. The question is whether its being left black then updated or if its being updated by something before it gets through this process.

@eoliveros
Copy link
Contributor Author

did a test by creating new account and new wallet. and it looks like when scanning the qrcode this is setting the wallet_address in the "User" table. Still investigating to see what could be writing this "User".wallet_address and change it somehow.

@eoliveros
Copy link
Contributor Author

I can't see what's writing the "User".wallet_address, its leading me to believe that this is being triggered by the merchant app, rather that the merchant server. If thats true, all I need to do is to remove the rebate_address on the "information" column on the "User" table.

but since we are have to generate the wallet_address from the seed and put it in the "User" table, need more trying to figure out how to do that.

@eoliveros
Copy link
Contributor Author

done the following:
Seeds table now has a wallet_address field. This is populated when the wallet_seed is added on_model_change. User.wallet_address is then populated by calling:

db.session.query(User).filter(User.id == model.user_id).update({User.wallet_address: model.wallet_address})

after_model_change.

So this meant that we don't necessarily need to scan the api-key qrcode to populate the User.wallet_address. Not sure, what else the api-key qrcode does or if the function that does it, does other things apart from populating the User.wallet_address field.

The User.wallet_address field is also used for the MerchantTx. Looks like its populating the table with the transactions for the merchant. So I need to look at and see if I can make this into looking at moving it away from the User.wallet_address to Seeds.wallet_address,etc......

@eoliveros
Copy link
Contributor Author

eoliveros commented Apr 13, 2021

noticed something funky with the emrchant app.

the amount of zap that you send when placing the nzd value is weird. currently the server is setup for the customer_rate of 8%. getting the following:

NZD    ZAP(cents)
1          109
2          218
3          327
4          436
5          546

NZD * 100 + (customer_rate + transaction_fee)

…ls the same as zapd. seed table added as well. initial test for sending from invidividual wallets works. Removed teh commented lines i could find. Also still trying to figure out how to change the create_view for the Proposal, wanted it to check to make sure that the Seeds.wallet_seed is not empty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants