-
Notifications
You must be signed in to change notification settings - Fork 204
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
3.0.0: Refactor Transaction
class
#854
Conversation
a4f56c1
to
13e0add
Compare
13e0add
to
790e95f
Compare
@@ -89,7 +89,8 @@ jobs: | |||
$(lsb_release -cs) stable" | $SUDO tee /etc/apt/sources.list.d/docker.list > /dev/null | |||
$SUDO apt update | |||
$SUDO apt -y install docker-ce docker-ce-cli containerd.io | |||
- browser-tools/install-browser-tools | |||
- browser-tools/install-browser-tools: | |||
replace-existing-chrome: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ensures we always get the latest stable chrome version, which our browser testing relies on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to intentionally test on a cross-range of versions? Wondering if instead of doing latest, we should do latest, plus X releases back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There may be some value in selecting an older chrome version to test against, so that we can be sure the code isn't relying on APIs/behaviors that we think are too new.
But in reality it's easiest to test against latest and we still benefit a lot from having this.
I only included this change because for some reason circle stopped installing the latest chrome by default, which broke our test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts and questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial set of comments, about 20 files in.
@@ -89,7 +89,8 @@ jobs: | |||
$(lsb_release -cs) stable" | $SUDO tee /etc/apt/sources.list.d/docker.list > /dev/null | |||
$SUDO apt update | |||
$SUDO apt -y install docker-ce docker-ce-cli containerd.io | |||
- browser-tools/install-browser-tools | |||
- browser-tools/install-browser-tools: | |||
replace-existing-chrome: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to intentionally test on a cross-range of versions? Wondering if instead of doing latest, we should do latest, plus X releases back.
@@ -51,13 +51,12 @@ async function main() { | |||
// example: ATOMIC_GROUP_SEND | |||
|
|||
// example: CONST_MIN_FEE | |||
const minFee = algosdk.ALGORAND_MIN_TX_FEE; | |||
console.log(minFee); | |||
// This SDK does not expose a constant for the minimum fee | |||
// example: CONST_MIN_FEE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove the comment references to CONST_MIN_FEE entirely? Also, there seems to be two identical lines for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These comments are used to populate snippets of code in the dev site. This specific one is used here: https://developer.algorand.org/docs/get-details/dapps/smart-contracts/guidelines/#get-minimum-fee-off-chain-with-sdk
I think we want to preserve JS in that tab, but just have a comment saying a hard coded min fee is not available. That's currently what happens for the "using an algod API" JS snippet on that page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this large of a refactor, found myself wishing we had a test coverage tool on the SDK. It was hard for me to track down if the varying types were handled properly etc and if we had added new tests in all the places they made sense.
@@ -478,235 +487,4 @@ describe('Multisig Functionality', () => { | |||
}, new Error('Invalid multisig transaction, multisig structure missing at index 1')); | |||
}); | |||
}); | |||
|
|||
describe('read-only transaction methods should work as expected on multisig transactions', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what was removed that made these irrelevant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MultisigTransaction
class was removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general LGTM, not sure I am following the number | bigint
vs bigint
logic. Plus, few questions/remarks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Specifically,
Transaction
class, separated input type from internal representation (e.g. input types can benumber | bigint
, but internally the type is stored asbigint
). Fixes RefactorTransaction
class #850makePaymentTxnWithSuggestedParams(from, to, amount, closeRemainderTo, note, suggestedParams, rekeyTo)
replaced bymakePaymentTxnWithSuggestedParamsFromObject(object)
){ from: addr, to: adder, ... }
)SuggestedParams
andSuggestedParamsWithMinFee
. Min fee is now required inSuggestedParams
Address
class. Prior to this, addresses were represented internally in either their string form, or a deconstructed object containing public key and checksum. The newAddress
class standardizes the format used, and internally it only contains the 32 byte public key componentMultisigTransaction
andTxGroup
classesAdditionally I started a v2 to v3 migration guide
Follow up to #853