-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…s-from-cached-wallet-db E2e tests against cached wallet db
- Loading branch information
Showing
14 changed files
with
335 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,16 @@ jobs: | |
node-db-docker-${{ env.NETWORK }}- | ||
node-db-Linux-${{ env.NETWORK }}- | ||
- name: 💾 Cache wallet db | ||
id: cache-wallet | ||
uses: actions/[email protected] | ||
with: | ||
path: test/e2e/state/wallet_db/${{ env.NETWORK }} | ||
key: wallet-db-${{ runner.os }}-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }} | ||
restore-keys: | | ||
wallet-db-${{ runner.os }}-${{ env.NETWORK }}- | ||
wallet-db-Linux-${{ env.NETWORK }}- | ||
- name: 🚀 Start node and wallet | ||
run: | | ||
echo "Wallet: $WALLET" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,15 @@ jobs: | |
restore-keys: | | ||
node-db-${{ runner.os }}-${{ env.NETWORK }}- | ||
- name: 💾 Cache wallet db | ||
id: cache-wallet | ||
uses: actions/[email protected] | ||
with: | ||
path: test/e2e/state/wallet_db/${{ env.NETWORK }} | ||
key: wallet-db-${{ runner.os }}-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }} | ||
restore-keys: | | ||
wallet-db-${{ runner.os }}-${{ env.NETWORK }}- | ||
- name: ⚙️ Setup (get latest bins and configs and decode fixtures) | ||
run: rake setup[$NETWORK,$PR] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,15 @@ jobs: | |
node-db-${{ runner.os }}-${{ env.NETWORK }}- | ||
node-db-Linux-${{ env.NETWORK }}- | ||
- name: 💾 Cache wallet db | ||
id: cache-wallet | ||
uses: actions/[email protected] | ||
with: | ||
path: test/e2e/state/wallet_db/${{ env.NETWORK }} | ||
key: wallet-db-${{ runner.os }}-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }} | ||
restore-keys: | | ||
wallet-db-${{ runner.os }}-${{ env.NETWORK }}- | ||
- name: ⚙️ Setup (get latest bins and configs and decode fixtures) | ||
run: rake setup[$NETWORK,$PR] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,15 @@ jobs: | |
node-db-${{ runner.os }}-${{ env.NETWORK }}- | ||
node-db-Linux-${{ env.NETWORK }}- | ||
- name: 💾 Cache wallet db | ||
id: cache-wallet | ||
uses: actions/[email protected] | ||
with: | ||
path: test/e2e/state/wallet_db/${{ env.NETWORK }} | ||
key: wallet-db-${{ runner.os }}-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }} | ||
restore-keys: | | ||
wallet-db-${{ runner.os }}-${{ env.NETWORK }}- | ||
- name: ⚙️ Setup (get latest bins and configs and decode fixtures) | ||
run: rake setup[%NETWORK%,%PR%] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## | ||
# Class for keeping track of wallet ids. WalletFactory keeps track of the context. | ||
# CONTEXT = Context.new | ||
# WalletFactory.create(:shelley, payload) | ||
# CONTEXT.shelley.each do |wid| | ||
# WalletFactory.delete(:shelley, wid) | ||
# end | ||
class Context | ||
attr_accessor :shelley, :shared, :byron | ||
def initialize | ||
clear! | ||
end | ||
|
||
def clear! | ||
@shelley = [] | ||
@shared = [] | ||
@byron = [] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
## | ||
# Factory helper for creating and deleting wallets and keeping their ids in shared context. | ||
# Assumes CONTEXT, SHELLEY, SHARED, BYRON to be initialized. | ||
class WalletFactory | ||
def self.create(type, payload) | ||
case type | ||
when :shelley | ||
wallet = SHELLEY.wallets.create(payload) | ||
CONTEXT.shelley << wallet['id'] | ||
wallet | ||
when :shared | ||
wallet = SHARED.wallets.create(payload) | ||
CONTEXT.shared << wallet['id'] | ||
wallet | ||
when :byron | ||
wallet = BYRON.wallets.create(payload) | ||
CONTEXT.byron << wallet['id'] | ||
wallet | ||
else | ||
raise "Unsupported wallet type: #{type}." | ||
end | ||
end | ||
|
||
def self.delete(type, wid) | ||
case type | ||
when :shelley | ||
CONTEXT.shelley.delete(wid) | ||
SHELLEY.wallets.delete(wid) | ||
when :shared | ||
CONTEXT.shared.delete(wid) | ||
SHARED.wallets.delete(wid) | ||
when :byron | ||
CONTEXT.byron.delete(wid) | ||
BYRON.wallets.delete(wid) | ||
else | ||
raise "Unsupported wallet type: #{type}." | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.