Skip to content

Redeem integration test where the issuer is also the party that asks to redeem a token #1076

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions integration/ports.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ var (

AllTestTypes = []*InfrastructureType{
WebSocketNoReplication,
LibP2PNoReplication,
WebSocketWithReplication,
// LibP2PNoReplication,
// WebSocketWithReplication,
}
)

Expand Down
1 change: 1 addition & 0 deletions integration/token/fungible/ofabtoken/fabtoken_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var _ = Describe("Orion EndToEnd", func() {
BeforeEach(ts.Setup)
AfterEach(ts.TearDown)
It("succeeded", Label("T1"), func() { fungible.TestAll(ts.II, "auditor", nil, true, true, selector) })
It("Test redeem", Label("T2"), func() { fungible.TestRedeem(ts.II, selector, "orion") })
})
}
})
Expand Down
28 changes: 28 additions & 0 deletions integration/token/fungible/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -1460,3 +1460,31 @@ func TestMultiSig(network *integration.Infrastructure, sel *token3.ReplicaSelect
CheckCoOwnedBalance(network, charlie, "", "USD", 0)
CheckCoOwnedBalance(network, manager, "", "USD", 0)
}

func TestRedeem(network *integration.Infrastructure, sel *token3.ReplicaSelector, networkName string) {
auditor := sel.Get("auditor")
issuer := sel.Get("issuer")
alice := sel.Get("alice")

RegisterAuditor(network, auditor)

// give some time to the nodes to get the public parameters - Q - may now be needed. waiting in UpdatePublicParamsAndWait.
time.Sleep(10 * time.Second)

SetKVSEntry(network, issuer, "auditor", auditor.Id())
CheckPublicParams(network, issuer, auditor, alice)

Eventually(DoesWalletExist).WithArguments(network, issuer, "", views.IssuerWallet).WithTimeout(1 * time.Minute).WithPolling(15 * time.Second).Should(Equal(true))
Eventually(DoesWalletExist).WithArguments(network, issuer, "pineapple", views.IssuerWallet).WithTimeout(1 * time.Minute).WithPolling(15 * time.Second).Should(Equal(false))

IssueCash(network, "", "USD", 110, alice, auditor, true, issuer)
CheckBalance(network, alice, "", "USD", 110)
CheckHolding(network, alice, "", "USD", 110, auditor)

RedeemCash(network, alice, "", "USD", 10, auditor, issuer)
CheckBalance(network, alice, "", "USD", 100)
CheckHolding(network, alice, "", "USD", 100, auditor)

TransferCash(network, alice, "", "USD", 10, issuer, auditor)
CheckBalance(network, alice, "", "USD", 90)
}
Loading