Skip to content

Decouple calculate fee from Wallet#2354

Closed
shargon wants to merge 3 commits intoneo-project:masterfrom
shargon:decouple-calculate-fee
Closed

Decouple calculate fee from Wallet#2354
shargon wants to merge 3 commits intoneo-project:masterfrom
shargon:decouple-calculate-fee

Conversation

@shargon
Copy link
Member

@shargon shargon commented Feb 19, 2021

Close #2352

@shargon shargon requested a review from erikzhang February 19, 2021 08:03
}

tx.NetworkFee = CalculateNetworkFee(snapshot, tx);
tx.NetworkFee = CalculateNetworkFee(snapshot, tx, ProtocolSettings, (a) => GetAccount(a)?.Contract?.Script);
Copy link
Contributor

@Qiao-Jin Qiao-Jin Feb 19, 2021

Choose a reason for hiding this comment

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

It seems we still need to rely on Wallet for func CalculateNetworkFee

Copy link
Member Author

Choose a reason for hiding this comment

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

You can use this method if you have a dictionary

Copy link
Member

@vncoelho vncoelho left a comment

Choose a reason for hiding this comment

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

Looks good to me.
It opens more possibilities, in my opnion.

@vncoelho
Copy link
Member

vncoelho commented Feb 19, 2021

@shargon, my idea was that with this change we would be able to, in the future, add a new call on neo-modules RPCServer to make this calculation generic as a RPC call.

However, we need to discuss if this would be a good practice.
One thing is to create the script of a transaction with InvokeFunction.
Another thing is to really pass verificationScripts beforehand.
In my opinion, there is not much problem because, anyway, seed nodes will have it in advance of consensus.

@superboyiii
Copy link
Member

@erikzhang Merge?

@cschuchardt88
Copy link
Member

@shargon Wasn't this fixed already?

@Jim8y Jim8y added the Need Active Pr will be closed after one week if no new activity. label Feb 12, 2024
@Jim8y
Copy link
Contributor

Jim8y commented Feb 18, 2024

Close as inactive

@Jim8y Jim8y closed this Feb 18, 2024
@shargon
Copy link
Member Author

shargon commented Feb 18, 2024

I want to do this, it doesn't hurt I think

@shargon shargon reopened this Feb 18, 2024
@Jim8y
Copy link
Contributor

Jim8y commented Feb 18, 2024

Then please update. I am not against any pr, if you update it, we can finish it.

@shargon
Copy link
Member Author

shargon commented Feb 18, 2024

Moved to #3147

@shargon shargon deleted the decouple-calculate-fee branch February 18, 2024 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Need Active Pr will be closed after one week if no new activity. Need Update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Question] Does CalculateNetworkFee(DataCache snapshot, Transaction tx) needs to be inside Wallet? Make network fee calculation more generic.

7 participants