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 origin field to dispensers and allow close/refill/reopen #1253

Merged
merged 9 commits into from
Oct 9, 2023

Conversation

pataegrillo
Copy link
Contributor

  • Now the dispenser origin address can close and refill the dispenser

- Now the dispenser origin address can close and refill the dispenser
# Conflicts:
#	counterpartylib/lib/messages/dispenser.py
#	counterpartylib/protocol_changes.json
- Fixed btc balance checking code nesting
# Conflicts:
#	counterpartylib/protocol_changes.json
@jdogresorg jdogresorg changed the title Added origin field to dispensers, it's the creator of the dispenser Added origin field to dispensers and allow close/refill Oct 4, 2023
@jdogresorg
Copy link
Contributor

Database Testing

  • dispensers table has origin field - OK
  • dispensers origin field is populated - OK
  • dispenser_refills table has been created - OK
  • dispenser_refills table has been populated with refill data - OK

@jdogresorg
Copy link
Contributor

EMPTY address Testing

ADDRESS1 = 1HMEbo7TdpmUs2buZSKFsGVPSchcKx8v8o = EMPTY (no btc or xcp history)
ADDRESS2 = 1GJwQgYheNdvUrMaCQwKiQNwMBm8ty3H1x = XCP History (no btc history)
ADDRESS3 = 164rPU7C9gRx4q9VxCcLsiyh2tfC98jSPK = BTC history (no xcp history)

api1

1HMEbo7TdpmUs2buZSKFsGVPSchcKx8v8o = ADDRESS1 - VALID
1GJwQgYheNdvUrMaCQwKiQNwMBm8ty3H1x = ADDRESS2 - FAILED
164rPU7C9gRx4q9VxCcLsiyh2tfC98jSPK = ADDRESS3 - VALID

dev1

1HMEbo7TdpmUs2buZSKFsGVPSchcKx8v8o = ADDRESS1 - VALID
1GJwQgYheNdvUrMaCQwKiQNwMBm8ty3H1x = ADDRESS2 - FAILED
164rPU7C9gRx4q9VxCcLsiyh2tfC98jSPK = ADDRESS3 - FAILED

It appears that EMPTY is still defined as no BTC or XCP history 👍

@jdogresorg
Copy link
Contributor

jdogresorg commented Oct 4, 2023

Dispenser Testing Info

Address List

mvThcDEbeqog2aJ7JNj1FefUPaNdYYGqHt = Source / Origin
mznL38eTJrSbsik7LwtqzgzGgtjKRvrCQf = NORMAL1
mi6kUwR6kD7H1ikqJLVhkBzRsf99ZDtTCA = EMPTY1
msCchnUNaNbH2popC15QLkJpmXNck4LDPZ = EMPTY2

source address testing

  • open dispenser on NORMAL1 address - 4cbe35196342829711e0495890a97ea5b72443c321cafd1b18cf0a0dbc75c0b7
    • verify funds debit from source - OK
  • refill dispenser on NORMAL1 address from source - 981f92f8bd4b3584f3902c4d1aa6a09bd145ad7c9c4b37a5d24c871b25399eee
    • verify funds debit from source - OK
  • close dispenser on NORMAL1 address from source - c7f27ff85cf8bbd132b76332fb5937853fd19b908a0343ddaf190c8376bfffc2
    • verify funds credit to source - OK
  • open new dispenser on NORMAL1 address from source - 5609900b466062ef165fded72963bda26184a886d775e51b34eb50b8c82c821f
    • verify funds debit from source - OK
  • send payment to dispenser to close - e1fb332a1508832d7c0717d8879c186f031114a71085a3d678c511cfaec1d8c7
    • verify dispense is triggered - OK
    • verify dispenser is closed - OK

origin address testing

  • open dispenser on EMPTY1 address - 367a8fd39983521a175989e903ee2f1848e6ef5ea9f89dc503f0dab638bdeccd
    • verify funds debit from origin - OK
  • refill dispenser on EMPTY1 address from origin - 2b3c06ca06156daffa8afb06e30434578e0197e94cea7bd7db31b46646efdf75
    • verify funds debit from origin - OK
  • close dispenser on EMPTY1 address from origin - 94e42bc5cf3dbf5160e8c1e5ea22ea06a4c9645c6cc4e62111e4304da2005e06
    • verify funds credit to origin - OK
  • open a new dispenser on EMPTY1 address from origin - 9010a22f779c469a682cbd694e31eb2405376f3ca57ec24dc4b5dffe33fb7e7a
    • verify funds debit from origin - ???
  • open new dispenser on EMPTY1 address from non origin address - DONE
    • verify dispenser tx fails - OK
  • send payment to dispenser to close - 24546ca6edbcba3e33ba10a2cdc392ff808b6b25831ead2c8bdfb123e6471573
    • verify dispense is triggered -OK
    • verify dispenser is closed - OK

@jdogresorg
Copy link
Contributor

oracled dispenser testing

  • open dispenser on EMPTY2 address - 6678061134b2c7e086937ded963799e23b4203a1724ac211e48cf9ecc3f88335
    • verify funds debit from origin - OK
    • verify payment to oracle_address - OK
  • refill dispenser on EMPTY2 address from origin - 7daecc67e9d03c931fc064b6409fcfdce95503bc94d212d27824123380a34868
    • verify funds debit from origin - OK
    • verify payment to oracle_address - OK
  • close dispenser on EMPTY2 address from origin - 976af04a4adee01542cad5593613cabbf11ac990e5a18323cab75e249fd665e8
    • verify funds credit to origin - OK
  • open a new dispenser on EMPTY2 address from origin - be7c87be77d0def87b814d330a4dfbe8ba7b78a3ee1ce77a582f0601d706ace2
    • verify funds debit from origin - OK
    • verify payment to oracle_address - OK
  • send payment to dispenser to close - 791aa39d438a836c30c3c0e76b578e0bd817492ce0930940b0d8f979685bc807
    • verify dispense is triggered - OK
    • verify dispenser is closed - OK

@jdogresorg
Copy link
Contributor

jdogresorg commented Oct 9, 2023

origin address re-testing

  • open dispenser on EMPTY1 address - 76e1c0f3f231fecf137798427e3d1a6e70076c317805a070a5e94d84ddc408ba
    • verify funds debit from origin - OK
  • refill dispenser on EMPTY1 address from origin - b3d5560e7b6c692cb9c95493be535cd22a57ec16d8c9d3579c00561160bb94ea
    • verify funds debit from origin - OK
  • close dispenser on EMPTY1 address from origin - bfa94c1b6989647a5713150e8858035d9fe45fb444ddf4d95e39d61e518b9729
    • verify funds credit to origin - OK

PR still looks good after protocol change update.

@jdogresorg jdogresorg changed the title Added origin field to dispensers and allow close/refill Added origin field to dispensers and allow close/refill/reopen Oct 9, 2023
@jdogresorg jdogresorg merged commit 074e787 into CounterpartyXCP:master Oct 9, 2023
@jdogresorg jdogresorg mentioned this pull request Nov 17, 2023
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.

2 participants