Skip to content

Commit 580291a

Browse files
authored
[Framework] Resolve merge conflicts in supra framework (#295)
* resolve merge conflicts in framework * renaming * address comments * address comments * revert changes to AggregatableCoin * trivial * adapt to supra * rename * address comments
1 parent ea21e9b commit 580291a

23 files changed

Lines changed: 1788 additions & 674 deletions

aptos-move/framework/supra-framework/sources/account/account_abstraction.move

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ module supra_framework::account_abstraction {
201201
}
202202

203203
inline fun resource_addr(source: address): address {
204-
object::create_user_derived_object_address(source, @aptos_fungible_asset)
204+
object::create_user_derived_object_address(source, @supra_fungible_asset)
205205
}
206206

207207
fun update_dispatchable_authenticator_impl(

aptos-move/framework/supra-framework/sources/aggregator/aggregator_factory.move

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,18 @@ module supra_framework::aggregator_factory {
3939

4040
/// Creates a new aggregator instance which overflows on exceeding a `limit`.
4141
public(friend) fun create_aggregator_internal(): Aggregator acquires AggregatorFactory {
42+
create_aggregator_internal_with_limit(MAX_U128)
43+
}
44+
45+
/// Creates a new aggregator instance which overflows on exceeding a `limit`.
46+
public(friend) fun create_aggregator_internal_with_limit(limit: u128): Aggregator acquires AggregatorFactory {
4247
assert!(
4348
exists<AggregatorFactory>(@supra_framework),
4449
error::not_found(EAGGREGATOR_FACTORY_NOT_FOUND)
4550
);
4651

4752
let aggregator_factory = borrow_global_mut<AggregatorFactory>(@supra_framework);
48-
new_aggregator(aggregator_factory, MAX_U128)
53+
new_aggregator(aggregator_factory, limit)
4954
}
5055

5156
#[deprecated]

aptos-move/framework/supra-framework/sources/aggregator/optional_aggregator.move

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,21 @@ module supra_framework::optional_aggregator {
8888
}
8989
}
9090

91+
/// Creates a new optional aggregator.
92+
public(friend) fun new_with_limit(limit: u128, parallelizable: bool): OptionalAggregator {
93+
if (parallelizable) {
94+
OptionalAggregator {
95+
aggregator: option::some(aggregator_factory::create_aggregator_internal_with_limit(limit)),
96+
integer: option::none(),
97+
}
98+
} else {
99+
OptionalAggregator {
100+
aggregator: option::none(),
101+
integer: option::some(new_integer(limit)),
102+
}
103+
}
104+
}
105+
91106
/// Switches between parallelizable and non-parallelizable implementations.
92107
public fun switch(_optional_aggregator: &mut OptionalAggregator) {
93108
abort error::invalid_state(ESWITCH_DEPRECATED)

aptos-move/framework/supra-framework/sources/code.spec.move

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,6 @@ spec supra_framework::code {
7979
aborts_if !permissioned_signer::spec_check_permission_exists(s, perm);
8080
}
8181

82-
spec schema AbortsIfPermissionedSigner {
83-
use aptos_framework::permissioned_signer;
84-
s: signer;
85-
let perm = CodePublishingPermission {};
86-
aborts_if !permissioned_signer::spec_check_permission_exists(s, perm);
87-
}
88-
8982
spec initialize(supra_framework: &signer, package_owner: &signer, metadata: PackageMetadata) {
9083
let aptos_addr = signer::address_of(supra_framework);
9184
let owner_addr = signer::address_of(package_owner);

0 commit comments

Comments
 (0)